I have a Quarkus Command mode application which will execute a batch job and does some auditing using a rest service.
I am injecting a mockserver into the test class
@QuarkusMainTest
@QuarkusTestResource(MockServer.class)
This is my test
@Test
@Launch()
public void testLaunchCommand(LaunchResult result) {
setupMockPositiveSubmitLoggingEvent(logMockServerClient);
Assertions.assertEquals(0, result.exitCode());
Assertions.assertTrue(result.getOutput().contains("BatchJobInterface"));
}
It is unable to pick the mock server url and return mocked response and assertions fail.
Documentation says Injection is not allowed but they can be injected using test profiles. Can someone help with any sample or reference.
I configured mockserver url in application properties file and starting the mockserver manually. It still complains of IllegalStateException when I try to hit the rest service url