Closed jayasree44 closed 6 years ago
If I remove the autowiring and create instance of HttpClient in my class and when I make designer.http().client(todoListClient().send().get(/demo)) call. It throws me null pointer exception.
java.lang.NullPointerException at com.esrx.eds.location.cucumber.stepDefinition.Steps.i_make_a_request_to_the(Steps.java:81) at ✽.And I make a "GET" request to the "http://localhost:8080"(Features/LatLong.feature:10)
This is occurring due to designer.http()
Hi!
Have you added a citrus-application.properties
file to your resource folder containing the classpath to the Java configuration file?
E.g. citrus.spring.java.config=com.consol.citrus.samples.todolist.EndpointConfig
BR, Sven
BTW:
designer.http().client(todoListClient().send().get(/demo))
This is not how the API is designed. This shouldn't even compile, because /demo
is not a string and the client
message accepts a HttpClient
and not a HttpClientRequestActionBuilder
that would be returned from get
.
Try this one
designer.http()
.client(todoListClient())
.send()
.get("/demo");
with
private HttpClient todoListClient() {
return CitrusEndpoints.http()
.client()
.requestUrl("http://foo.bar")
.build();
}
or simply inline the url, if you just want to test around.
designer.http()
.client("http://foo.bar")
.send()
.get("/demo");
Closed because of inactivity.
Hi I've created an application similar to it. But autowire doesn't work in my application. And also when I use citrusReporter as a plugin I'm getting exception.
My definitions look as below
https://github.com/citrusframework/citrus-samples/blob/master/samples-cucumber/sample-cucumber-spring/java-dsl/src/test/java/todo/TodoSteps.java