1
是否可以將黃瓜與CamelBlueprintTestSupport結合?我有我的亞軍類:駱駝藍圖測試和黃瓜
@RunWith(Cucumber.class)
@CucumberOptions(monochrome=true,
format={ "pretty", "html:target/cucumber"},
features = "C:/Users/Developer/workspace_camel/SRV002_PatronInformation/src/test/resources/cucumber/asynchronousErrorHandling.feature")
public class RunFeature_SRV002_PatronInformationTest {
}
我與場景藍圖測試類:
public class SRV002_PatronInformationScenarioTest extends CamelBlueprintTestSupport {
@Override
protected String getBlueprintDescriptor() {
return "/OSGI-INF/blueprint/blueprint.xml";
}
@Given("^client communicates asynchronous via socket$")
public void client_communicates_asynchronous_via_socket() throws Throwable {
System.out.println("test");
}
@When("^client posts message$")
public void an_error_occurs_inside_the_integration() throws Throwable {
String endpoint = "netty4:tcp://localhost:5000?sync=false&textline=true";
template.sendBody(endpoint, "test");
}
@Then("^the integration should not return response to the client$")
public void the_integration_should_not_return_the_error_to_the_client() throws Throwable {
System.out.println("test");
}
}
現在的問題是,當我運行這個我在template.sendbody因爲上下文中運行到NullPointerException異常,捆綁和路線尚未開始。出於某種原因,似乎添加@RunWith(黃瓜)阻止駱駝路線開始。
任何人都知道如何解決這個問題?謝謝 文章