Можно ли комбинировать огурец с 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");
}
}
Теперь проблема в том, что когда я запускаю это, я сталкиваюсь с исключением nullpointerexception в template.sendbody, потому что контекст, пакет и маршруты еще не запущены. По какой-то причине кажется, что добавление @RunWith(Cucumber) предотвращает запуск верблюжьих маршрутов.
Кто-нибудь знает, как это можно решить? Спасибо.