I'm trying to write integration test with Citrus framework and I keep getting NullPointerException on http() line.
And here is the stacktrace.
java.lang.NullPointerException at com.consol.citrus.dsl.testng.TestNGCitrusTestDesigner.http(TestNGCitrusTestDesigner.java:438) at com.test.tests.RestProviderIT.testGetUsers(RestAppIT.java:32) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source)
public class RestAppIT extends TestNGCitrusTestDesigner{
@Autowired
private HttpClient restClient;
@Test
@CitrusTest
public void testGetUsers() {
http()
.client(restClient)
.send()
.get("/comp/users")
.accept(ContentType.APPLICATION_JSON.getMimeType());
http()
.client(restClient)
.receive()
.response(HttpStatus.OK)
.messageType(ContentType.APPLICATION_JSON.getMimeType());
}
}
I have setup the endpointconfig class and defined the restClient there. Can you help me with this issue?