Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JUnit 5 parallel test execution with ParameterizedTest #711

Open
pablomxnl opened this issue Mar 18, 2020 · 0 comments
Open

JUnit 5 parallel test execution with ParameterizedTest #711

pablomxnl opened this issue Mar 18, 2020 · 0 comments

Comments

@pablomxnl
Copy link

Citrus Version
2.8.0

Question
Since TestNG dataprovider with parallel execution is open #350,
I was trying to see if it would work with a JUnit 5 ParameterizedTest.
It seems is not supported, everything is fine when I set junit.jupiter.execution.parallel.enabled=false,
but when I set it to true I get the errors below.

Would like to know if there is a workaround to sending multiple http requests in parallel

What I've tried so far

@ExtendWith(CitrusExtension.class)
public class AppTestIT {

    private static final Logger LOGGER = LoggerFactory.getLogger(AppTestIT.class);

    @CitrusEndpoint
    private HttpClient restApiClient;

    private static Stream<Arguments> testArguments() {
        return Stream.of(
            Arguments.of(new Book("Peter Jackson", "The Lord of The Rings"), "isbn1"),
            Arguments.of(new Book("Keanu Reeves", "The Matrix"), "isbn2"),
            Arguments.of(new Book("John Snow", "Winter is coming"), "isbn3")
        );
    }

    @ParameterizedTest
    @MethodSource("testArguments")
    @CitrusTest
    @DisplayName("Test {1}")
    public void testTheApi(Book aBook, String isbn, @CitrusResource TestRunner runner) {

        runner.http(httpActionBuilder -> httpActionBuilder
            .client(restApiClient)
            .send().post("/books").payload(
                String.format(
                    "{\n"
                        + "  \"author\" : \"%s\",\n"
                        + "  \"title\" : \"%s\",\n"
                        + "  \"isbn\" : \"%s\"\n"
                        + "}", aBook.getAuthor(), aBook.getTitle(), isbn
                )).fork(true)
        );

        runner.http(httpActionBuilder -> httpActionBuilder
            .client(restApiClient)
            .receive()
            .response()
            .messageType(MessageType.JSON)
            .status(HttpStatus.CREATED)
            .extractFromPayload("$.id", "bookId")
        );

//        LOGGER.debug("BookId: {}", context.getVariable("bookId"));

        runner.http(httpActionBuilder -> httpActionBuilder
            .client(restApiClient)
            .send().get("/books")
        );

        runner.http(httpActionBuilder -> httpActionBuilder
            .client(restApiClient)
            .receive()
            .response()
            .messageType(MessageType.JSON)
            .status(HttpStatus.OK)
            .validate("$.books", "@contains('${bookId}')@")
        );
    }
}

Result 1, not all requests are sent due to a ConcurrentModification exception

[INFO] Running com.example.AppTestIT
19:43:06,358 DEBUG        citrus.Citrus| Loading Citrus application properties
19:43:06,359 DEBUG        citrus.Citrus| Setting application property citrus.spring.java.config=com.example.EndpointConfig
19:43:06,448 INFO  igApplicationContext| Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@3f11e204: startup date [Wed Mar 18 19:43:06 CET 2020]; root of context hierarchy
19:43:06,550 DEBUG BeanDefinitionReader| Loaded 0 bean definitions from location pattern [classpath*:citrus-context.xml]
19:43:07,018 INFO  port.LoggingReporter| 
19:43:07,018 INFO  port.LoggingReporter| ------------------------------------------------------------------------
19:43:07,018 INFO  port.LoggingReporter|        .__  __                       
19:43:07,018 INFO  port.LoggingReporter|   ____ |__|/  |________ __ __  ______
19:43:07,018 INFO  port.LoggingReporter| _/ ___\|  \   __\_  __ \  |  \/  ___/
19:43:07,019 INFO  port.LoggingReporter| \  \___|  ||  |  |  | \/  |  /\___ \ 
19:43:07,019 INFO  port.LoggingReporter|  \___  >__||__|  |__|  |____//____  >
19:43:07,019 INFO  port.LoggingReporter|      \/                           \/
19:43:07,019 INFO  port.LoggingReporter| 
19:43:07,019 INFO  port.LoggingReporter| C I T R U S  T E S T S  2.8.0
19:43:07,019 INFO  port.LoggingReporter| 
19:43:07,019 INFO  port.LoggingReporter| ------------------------------------------------------------------------
19:43:07,019 DEBUG port.LoggingReporter| BEFORE TEST SUITE
19:43:07,019 INFO  port.LoggingReporter| 
19:43:07,019 INFO  port.LoggingReporter| 
19:43:07,020 INFO  port.LoggingReporter| BEFORE TEST SUITE: SUCCESS
19:43:07,020 INFO  port.LoggingReporter| ------------------------------------------------------------------------
19:43:07,020 INFO  port.LoggingReporter| 
19:43:07,049 DEBUG t.TestContextFactory| Created new test context - using global variables: '{}'
19:43:07,049 DEBUG t.TestContextFactory| Created new test context - using global variables: '{}'
19:43:07,049 DEBUG t.TestContextFactory| Created new test context - using global variables: '{}'
19:43:07,050 DEBUG ns.CitrusAnnotations| Injecting Citrus endpoint on test class field 'restApiClient'
19:43:07,050 DEBUG ns.CitrusAnnotations| Injecting Citrus endpoint on test class field 'restApiClient'
19:43:07,050 DEBUG ns.CitrusAnnotations| Injecting Citrus endpoint on test class field 'restApiClient'
19:43:07,055 DEBUG t.TestContextFactory| Created new test context - using global variables: '{}'
19:43:07,064 INFO  port.LoggingReporter| 
19:43:07,064 INFO  port.LoggingReporter| ------------------------------------------------------------------------
19:43:07,064 INFO  port.LoggingReporter| 
19:43:07,064 INFO  port.LoggingReporter| ------------------------------------------------------------------------
19:43:07,064 INFO  port.LoggingReporter| 
19:43:07,065 INFO  port.LoggingReporter| ------------------------------------------------------------------------
19:43:07,065 DEBUG port.LoggingReporter| STARTING TEST AppTestIT.testTheApi <com.example>
19:43:07,065 INFO  port.LoggingReporter| 
19:43:07,064 DEBUG port.LoggingReporter| STARTING TEST AppTestIT.testTheApi <com.example>
19:43:07,065 DEBUG      citrus.TestCase| Initializing test case
19:43:07,065 DEBUG port.LoggingReporter| STARTING TEST AppTestIT.testTheApi <com.example>
19:43:07,065 INFO  port.LoggingReporter| 
19:43:07,065 INFO  port.LoggingReporter| 
19:43:07,065 DEBUG      citrus.TestCase| Initializing test case
19:43:07,066 DEBUG  context.TestContext| Setting variable: citrus.test.name with value: 'AppTestIT.testTheApi'
19:43:07,066 DEBUG  context.TestContext| Setting variable: citrus.test.package with value: 'com.example'
19:43:07,066 DEBUG      citrus.TestCase| Test variables:
19:43:07,066 DEBUG      citrus.TestCase| citrus.test.package = com.example
19:43:07,066 DEBUG      citrus.TestCase| citrus.test.name = AppTestIT.testTheApi
19:43:07,065 DEBUG      citrus.TestCase| Initializing test case
19:43:07,067 DEBUG      citrus.TestCase| Global variables:
19:43:07,067 DEBUG      citrus.TestCase| citrus.test.package = com.example
19:43:07,067 DEBUG      citrus.TestCase| citrus.test.name = AppTestIT.testTheApi
19:43:07,066 DEBUG  context.TestContext| Setting variable: citrus.test.name with value: 'AppTestIT.testTheApi'
19:43:07,067 DEBUG  context.TestContext| Setting variable: citrus.test.package with value: 'com.example'
19:43:07,067 DEBUG  context.TestContext| Setting variable: citrus.test.name with value: 'AppTestIT.testTheApi'
19:43:07,068 DEBUG      citrus.TestCase| Test variables:
19:43:07,068 DEBUG  context.TestContext| Setting variable: citrus.test.package with value: 'com.example'
19:43:07,068 DEBUG      citrus.TestCase| Test variables:
19:43:07,068 DEBUG      citrus.TestCase| citrus.test.package = com.example
19:43:07,068 DEBUG      citrus.TestCase| citrus.test.package = com.example
19:43:07,069 DEBUG      citrus.TestCase| citrus.test.name = AppTestIT.testTheApi
19:43:07,068 DEBUG      citrus.TestCase| citrus.test.name = AppTestIT.testTheApi
19:43:07,099 INFO  port.LoggingReporter| 
19:43:07,099 INFO  port.LoggingReporter| 
19:43:07,099 INFO  port.LoggingReporter| 
19:43:07,100 DEBUG port.LoggingReporter| TEST STEP 3: send
19:43:07,100 DEBUG port.LoggingReporter| TEST STEP 2: send
19:43:07,099 DEBUG port.LoggingReporter| TEST STEP 1: send
19:43:07,289 DEBUG ltCorrelationManager| Saving correlation key for 'citrus_message_correlator_restApiClient'
19:43:07,289 DEBUG  context.TestContext| Setting variable: citrus_message_correlator_restApiClient with value: 'citrus_message_id = '9b14f128-3a0f-4e34-9d94-da07f2ce68f6''
19:43:07,289 DEBUG    client.HttpClient| Sending HTTP message to: 'http://localhost:8888/books'
19:43:07,290 DEBUG    client.HttpClient| Message to send:
{
  "author" : "John Snow",
  "title" : "Winter is coming",
  "isbn" : "isbn3"
}
19:43:07,305 INFO  port.LoggingReporter| 
19:43:07,306 ERROR port.LoggingReporter| TEST FAILED AppTestIT.testTheApi <com.example> Nested exception is: 
com.consol.citrus.exceptions.TestCaseFailedException: Test case failed
        at com.consol.citrus.TestCase.executeAction(TestCase.java:227)
        at com.consol.citrus.dsl.runner.DefaultTestRunner.run(DefaultTestRunner.java:188)
        at com.consol.citrus.dsl.runner.DefaultTestRunner.http(DefaultTestRunner.java:540)
        at com.example.AppTestIT.testTheApi(AppTestIT.java:43)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:675)
        at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
        at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:125)
        at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:132)
        at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:124)
        at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestTemplateMethod(TimeoutExtension.java:81)
        at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
        at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
        at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:104)
        at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:62)
        at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:43)
        at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:35)
        at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
        at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
        at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:202)
        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
        at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:198)
        at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135)
        at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:69)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:135)
        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
        at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
        at org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService$ExclusiveTask.compute(ForkJoinPoolHierarchicalTestExecutorService.java:171)
        at java.util.concurrent.RecursiveAction.exec(RecursiveAction.java:189)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: java.util.ConcurrentModificationException
        at java.util.ArrayList.sort(ArrayList.java:1464)
        at org.springframework.core.annotation.AnnotationAwareOrderComparator.sort(AnnotationAwareOrderComparator.java:125)
        at org.springframework.http.client.support.InterceptingHttpAccessor.setInterceptors(InterceptingHttpAccessor.java:64)
        at com.consol.citrus.http.client.HttpEndpointConfiguration.setClientInterceptors(HttpEndpointConfiguration.java:257)
        at com.consol.citrus.http.client.HttpClient.send(HttpClient.java:79)
        at com.consol.citrus.actions.SendMessageAction.doExecute(SendMessageAction.java:125)
        at com.consol.citrus.actions.AbstractTestAction.execute(AbstractTestAction.java:42)
        at com.consol.citrus.dsl.actions.DelegatingTestAction.doExecute(DelegatingTestAction.java:54)
        at com.consol.citrus.actions.AbstractTestAction.execute(AbstractTestAction.java:42)
        at com.consol.citrus.TestCase.executeAction(TestCase.java:220)
        ... 40 more
19:43:07,327 INFO  port.LoggingReporter| ------------------------------------------------------------------------
19:43:07,328 INFO  port.LoggingReporter| 
19:43:07,308 INFO  port.LoggingReporter| 
19:43:07,335 ERROR port.LoggingReporter| TEST FAILED AppTestIT.testTheApi <com.example> Nested exception is: 
com.consol.citrus.exceptions.TestCaseFailedException: Test case failed
        at com.consol.citrus.TestCase.executeAction(TestCase.java:227)
        at com.consol.citrus.dsl.runner.DefaultTestRunner.run(DefaultTestRunner.java:188)
        at com.consol.citrus.dsl.runner.DefaultTestRunner.http(DefaultTestRunner.java:540)
        at com.example.AppTestIT.testTheApi(AppTestIT.java:43)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:675)
        at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
        at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:125)
        at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:132)
        at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:124)
        at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestTemplateMethod(TimeoutExtension.java:81)
        at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
        at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
        at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:104)
        at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:62)
        at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:43)
        at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:35)
        at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
        at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
        at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:202)
        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
        at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:198)
        at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135)
        at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:69)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:135)
        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
        at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
        at org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService$ExclusiveTask.compute(ForkJoinPoolHierarchicalTestExecutorService.java:171)
        at java.util.concurrent.RecursiveAction.exec(RecursiveAction.java:189)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: java.util.ConcurrentModificationException
        at java.util.ArrayList.sort(ArrayList.java:1464)
        at org.springframework.core.annotation.AnnotationAwareOrderComparator.sort(AnnotationAwareOrderComparator.java:125)
        at org.springframework.http.client.support.InterceptingHttpAccessor.setInterceptors(InterceptingHttpAccessor.java:64)
        at com.consol.citrus.http.client.HttpEndpointConfiguration.setClientInterceptors(HttpEndpointConfiguration.java:257)
        at com.consol.citrus.http.client.HttpClient.send(HttpClient.java:79)
        at com.consol.citrus.actions.SendMessageAction.doExecute(SendMessageAction.java:125)
        at com.consol.citrus.actions.AbstractTestAction.execute(AbstractTestAction.java:42)
        at com.consol.citrus.dsl.actions.DelegatingTestAction.doExecute(DelegatingTestAction.java:54)
        at com.consol.citrus.actions.AbstractTestAction.execute(AbstractTestAction.java:42)
        at com.consol.citrus.TestCase.executeAction(TestCase.java:220)
        ... 40 more
19:43:07,337 INFO  port.LoggingReporter| ------------------------------------------------------------------------
19:43:07,337 INFO  port.LoggingReporter| 
19:43:07,419 DEBUG ingClientInterceptor| Sending Http request message
19:43:07,420 DEBUG ingClientInterceptor| Sending Http request message
19:43:07,636 DEBUG ingClientInterceptor| Received Http response message
19:43:07,636 DEBUG ingClientInterceptor| Received Http response message
19:43:07,639 INFO     client.HttpClient| HTTP message was sent to endpoint: 'http://localhost:8888/books'
19:43:07,642 DEBUG ltCorrelationManager| Saving correlated object for 'citrus_message_id = '9b14f128-3a0f-4e34-9d94-da07f2ce68f6''
19:43:07,643 INFO  port.LoggingReporter| 
19:43:07,643 DEBUG port.LoggingReporter| TEST STEP 3 SUCCESS
19:43:07,647 INFO  port.LoggingReporter| 
19:43:07,647 DEBUG port.LoggingReporter| TEST STEP 4: receive
19:43:07,648 DEBUG ngCorrelationManager| Get correlation key for 'citrus_message_correlator_restApiClient'
19:43:07,648 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = '9b14f128-3a0f-4e34-9d94-da07f2ce68f6''
19:43:07,648 DEBUG athVariableExtractor| Reading JSON elements with JSONPath
19:43:07,680 DEBUG athVariableExtractor| Evaluating JSONPath expression: $.id
19:43:07,691 DEBUG  context.TestContext| Setting variable: bookId with value: '8a6ea483-e5c3-4d9d-9a0b-3702b58fcaea'
19:43:07,693 DEBUG ageValidatorRegistry| Found 4 message validators for message type: JSON
19:43:07,694 DEBUG TextMessageValidator| Start JSON message validation ...
19:43:07,694 DEBUG TextMessageValidator| Received message:
HTTPMESSAGE [id: 4c3b18ec-790a-4e72-8173-f9699c03ae9c, payload: {"author":"John Snow","title":"Winter is coming","id":"8a6ea483-e5c3-4d9d-9a0b-3702b58fcaea"}][headers: {Transfer-Encoding=chunked, Server=Jetty(9.4.18.v20190429), contentType=application/json, Date=1584556987000, citrus_message_id=4c3b18ec-790a-4e72-8173-f9699c03ae9c, citrus_message_timestamp=1584556987642, Content-Type=application/json, citrus_http_status_code=201, citrus_http_reason_phrase=CREATED, citrus_http_version=HTTP/1.1}]
19:43:07,694 DEBUG TextMessageValidator| Control message:
HTTPMESSAGE [id: f01ea07e-ebc1-4b63-bace-016103550737, payload: ][headers: {citrus_message_id=f01ea07e-ebc1-4b63-bace-016103550737, citrus_message_timestamp=1584556987646, citrus_http_status_code=201, citrus_http_reason_phrase=CREATED, citrus_message_type=JSON}]
19:43:07,694 DEBUG TextMessageValidator| Skip message payload validation as no control message was defined
19:43:07,694 DEBUG ssageHeaderValidator| Start message header validation ...
19:43:07,699 DEBUG faultHeaderValidator| Validating header element: citrus_http_status_code='201': OK.
19:43:07,699 DEBUG faultHeaderValidator| Validating header element: citrus_http_reason_phrase='CREATED': OK.
19:43:07,699 INFO  ssageHeaderValidator| Message header validation successful: All values OK
19:43:07,699 INFO  port.LoggingReporter| 
19:43:07,699 DEBUG port.LoggingReporter| TEST STEP 4 SUCCESS
19:43:07,700 INFO  port.LoggingReporter| 
19:43:07,700 DEBUG port.LoggingReporter| TEST STEP 5: send
19:43:07,701 DEBUG ltCorrelationManager| Saving correlation key for 'citrus_message_correlator_restApiClient'
19:43:07,701 DEBUG  context.TestContext| Setting variable: citrus_message_correlator_restApiClient with value: 'citrus_message_id = 'eed6a191-739e-4928-8cad-fb039972ce52''
19:43:07,701 DEBUG    client.HttpClient| Sending HTTP message to: 'http://localhost:8888/books'
19:43:07,701 DEBUG    client.HttpClient| Message to send:

19:43:07,702 DEBUG ingClientInterceptor| Sending Http request message
19:43:07,702 DEBUG ingClientInterceptor| Sending Http request message
19:43:07,710 DEBUG ingClientInterceptor| Received Http response message
19:43:07,710 DEBUG ingClientInterceptor| Received Http response message
19:43:07,710 INFO     client.HttpClient| HTTP message was sent to endpoint: 'http://localhost:8888/books'
19:43:07,711 DEBUG ltCorrelationManager| Saving correlated object for 'citrus_message_id = 'eed6a191-739e-4928-8cad-fb039972ce52''
19:43:07,711 INFO  port.LoggingReporter| 
19:43:07,711 DEBUG port.LoggingReporter| TEST STEP 5 SUCCESS
19:43:07,712 INFO  port.LoggingReporter| 
19:43:07,712 DEBUG port.LoggingReporter| TEST STEP 6: receive
19:43:07,712 DEBUG ngCorrelationManager| Get correlation key for 'citrus_message_correlator_restApiClient'
19:43:07,712 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'eed6a191-739e-4928-8cad-fb039972ce52''
19:43:07,714 DEBUG ageValidatorRegistry| Found 4 message validators for message type: JSON
19:43:07,714 DEBUG TextMessageValidator| Start JSON message validation ...
19:43:07,715 DEBUG TextMessageValidator| Received message:
HTTPMESSAGE [id: d0b27b3f-0c93-43c7-88b3-e94768f6e263, payload: {"books":[{"author":"John Snow","title":"Winter is coming","id":"8a6ea483-e5c3-4d9d-9a0b-3702b58fcaea"}],"size":1}][headers: {Transfer-Encoding=chunked, Server=Jetty(9.4.18.v20190429), contentType=application/json, Date=1584556987000, citrus_message_id=d0b27b3f-0c93-43c7-88b3-e94768f6e263, citrus_message_timestamp=1584556987711, Content-Type=application/json, citrus_http_status_code=200, citrus_http_reason_phrase=OK, citrus_http_version=HTTP/1.1}]
19:43:07,715 DEBUG TextMessageValidator| Control message:
HTTPMESSAGE [id: aa559bd0-df55-4801-a9dc-475bf6013f9f, payload: ][headers: {citrus_message_id=aa559bd0-df55-4801-a9dc-475bf6013f9f, citrus_message_timestamp=1584556987712, citrus_http_status_code=200, citrus_http_reason_phrase=OK, citrus_message_type=JSON}]
19:43:07,715 DEBUG TextMessageValidator| Skip message payload validation as no control message was defined
19:43:07,715 DEBUG PathMessageValidator| Start JSONPath element validation ...
19:43:07,721 DEBUG PathMessageValidator| Validating element: $.books='@contains('8a6ea483-e5c3-4d9d-9a0b-3702b58fcaea')@': OK.
19:43:07,721 INFO  PathMessageValidator| JSONPath element validation successful: All values OK
19:43:07,722 DEBUG ssageHeaderValidator| Start message header validation ...
19:43:07,722 DEBUG faultHeaderValidator| Validating header element: citrus_http_status_code='200': OK.
19:43:07,722 DEBUG faultHeaderValidator| Validating header element: citrus_http_reason_phrase='OK': OK.
19:43:07,722 INFO  ssageHeaderValidator| Message header validation successful: All values OK
19:43:07,722 INFO  port.LoggingReporter| 
19:43:07,722 DEBUG port.LoggingReporter| TEST STEP 6 SUCCESS
19:43:07,723 DEBUG t.TestContextFactory| Created new test context - using global variables: '{}'
19:43:07,826 INFO  port.LoggingReporter| 
19:43:07,826 INFO  port.LoggingReporter| TEST SUCCESS AppTestIT.testTheApi (com.example)
19:43:07,826 INFO  port.LoggingReporter| ------------------------------------------------------------------------
19:43:07,826 INFO  port.LoggingReporter| 
[ERROR] Tests run: 3, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 1.494 s <<< FAILURE! - in com.example.AppTestIT

Result 2, all requests are sent, but the response is not collected for all, you can see that on the response of the get operation all the items are present.

[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.example.AppTestIT
19:47:13,175 DEBUG        citrus.Citrus| Loading Citrus application properties
19:47:13,175 DEBUG        citrus.Citrus| Setting application property citrus.spring.java.config=com.example.EndpointConfig
19:47:13,249 INFO  igApplicationContext| Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@7ba98ca: startup date [Wed Mar 18 19:47:13 CET 2020]; root of context hierarchy
19:47:13,349 DEBUG BeanDefinitionReader| Loaded 0 bean definitions from location pattern [classpath*:citrus-context.xml]
19:47:13,795 INFO  port.LoggingReporter| 
19:47:13,795 INFO  port.LoggingReporter| ------------------------------------------------------------------------
19:47:13,795 INFO  port.LoggingReporter|        .__  __                       
19:47:13,795 INFO  port.LoggingReporter|   ____ |__|/  |________ __ __  ______
19:47:13,795 INFO  port.LoggingReporter| _/ ___\|  \   __\_  __ \  |  \/  ___/
19:47:13,795 INFO  port.LoggingReporter| \  \___|  ||  |  |  | \/  |  /\___ \ 
19:47:13,795 INFO  port.LoggingReporter|  \___  >__||__|  |__|  |____//____  >
19:47:13,796 INFO  port.LoggingReporter|      \/                           \/
19:47:13,796 INFO  port.LoggingReporter| 
19:47:13,796 INFO  port.LoggingReporter| C I T R U S  T E S T S  2.8.0
19:47:13,796 INFO  port.LoggingReporter| 
19:47:13,796 INFO  port.LoggingReporter| ------------------------------------------------------------------------
19:47:13,796 DEBUG port.LoggingReporter| BEFORE TEST SUITE
19:47:13,796 INFO  port.LoggingReporter| 
19:47:13,796 INFO  port.LoggingReporter| 
19:47:13,796 INFO  port.LoggingReporter| BEFORE TEST SUITE: SUCCESS
19:47:13,796 INFO  port.LoggingReporter| ------------------------------------------------------------------------
19:47:13,796 INFO  port.LoggingReporter| 
19:47:13,826 DEBUG t.TestContextFactory| Created new test context - using global variables: '{}'
19:47:13,826 DEBUG t.TestContextFactory| Created new test context - using global variables: '{}'
19:47:13,826 DEBUG t.TestContextFactory| Created new test context - using global variables: '{}'
19:47:13,828 DEBUG ns.CitrusAnnotations| Injecting Citrus endpoint on test class field 'restApiClient'
19:47:13,828 DEBUG ns.CitrusAnnotations| Injecting Citrus endpoint on test class field 'restApiClient'
19:47:13,829 DEBUG ns.CitrusAnnotations| Injecting Citrus endpoint on test class field 'restApiClient'
19:47:13,835 DEBUG t.TestContextFactory| Created new test context - using global variables: '{}'
19:47:13,849 INFO  port.LoggingReporter| 
19:47:13,849 INFO  port.LoggingReporter| ------------------------------------------------------------------------
19:47:13,849 INFO  port.LoggingReporter| 
19:47:13,849 INFO  port.LoggingReporter| ------------------------------------------------------------------------
19:47:13,849 INFO  port.LoggingReporter| 
19:47:13,849 DEBUG port.LoggingReporter| STARTING TEST AppTestIT.testTheApi <com.example>
19:47:13,849 INFO  port.LoggingReporter| 
19:47:13,849 DEBUG port.LoggingReporter| STARTING TEST AppTestIT.testTheApi <com.example>
19:47:13,850 INFO  port.LoggingReporter| 
19:47:13,849 DEBUG      citrus.TestCase| Initializing test case
19:47:13,849 INFO  port.LoggingReporter| ------------------------------------------------------------------------
19:47:13,850 DEBUG port.LoggingReporter| STARTING TEST AppTestIT.testTheApi <com.example>
19:47:13,850 INFO  port.LoggingReporter| 
19:47:13,850 DEBUG      citrus.TestCase| Initializing test case
19:47:13,850 DEBUG      citrus.TestCase| Initializing test case
19:47:13,851 DEBUG  context.TestContext| Setting variable: citrus.test.name with value: 'AppTestIT.testTheApi'
19:47:13,851 DEBUG  context.TestContext| Setting variable: citrus.test.name with value: 'AppTestIT.testTheApi'
19:47:13,851 DEBUG  context.TestContext| Setting variable: citrus.test.name with value: 'AppTestIT.testTheApi'
19:47:13,851 DEBUG  context.TestContext| Setting variable: citrus.test.package with value: 'com.example'
19:47:13,851 DEBUG  context.TestContext| Setting variable: citrus.test.package with value: 'com.example'
19:47:13,851 DEBUG  context.TestContext| Setting variable: citrus.test.package with value: 'com.example'
19:47:13,852 DEBUG      citrus.TestCase| Test variables:
19:47:13,852 DEBUG      citrus.TestCase| Test variables:
19:47:13,851 DEBUG      citrus.TestCase| Test variables:
19:47:13,852 DEBUG      citrus.TestCase| citrus.test.package = com.example
19:47:13,852 DEBUG      citrus.TestCase| citrus.test.package = com.example
19:47:13,852 DEBUG      citrus.TestCase| citrus.test.package = com.example
19:47:13,852 DEBUG      citrus.TestCase| citrus.test.name = AppTestIT.testTheApi
19:47:13,852 DEBUG      citrus.TestCase| citrus.test.name = AppTestIT.testTheApi
19:47:13,852 DEBUG      citrus.TestCase| citrus.test.name = AppTestIT.testTheApi
19:47:13,895 INFO  port.LoggingReporter| 
19:47:13,895 INFO  port.LoggingReporter| 
19:47:13,895 DEBUG port.LoggingReporter| TEST STEP 2: send
19:47:13,895 INFO  port.LoggingReporter| 
19:47:13,895 DEBUG port.LoggingReporter| TEST STEP 3: send
19:47:13,895 DEBUG port.LoggingReporter| TEST STEP 1: send
19:47:14,078 DEBUG ltCorrelationManager| Saving correlation key for 'citrus_message_correlator_restApiClient'
19:47:14,078 DEBUG ltCorrelationManager| Saving correlation key for 'citrus_message_correlator_restApiClient'
19:47:14,078 DEBUG ltCorrelationManager| Saving correlation key for 'citrus_message_correlator_restApiClient'
19:47:14,079 DEBUG  context.TestContext| Setting variable: citrus_message_correlator_restApiClient with value: 'citrus_message_id = '3da81483-61c6-47e3-a818-31aded551f95''
19:47:14,078 DEBUG  context.TestContext| Setting variable: citrus_message_correlator_restApiClient with value: 'citrus_message_id = '83b9df8a-a1b2-46ad-a717-7968b90dd4a4''
19:47:14,079 DEBUG    client.HttpClient| Sending HTTP message to: 'http://localhost:8888/books'
19:47:14,079 DEBUG    client.HttpClient| Message to send:
{
  "author" : "Peter Jackson",
  "title" : "The Lord of The Rings",
  "isbn" : "isbn1"
}
19:47:14,079 DEBUG  context.TestContext| Setting variable: citrus_message_correlator_restApiClient with value: 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:14,080 DEBUG    client.HttpClient| Sending HTTP message to: 'http://localhost:8888/books'
19:47:14,080 DEBUG    client.HttpClient| Message to send:
{
  "author" : "John Snow",
  "title" : "Winter is coming",
  "isbn" : "isbn3"
}
19:47:14,079 DEBUG    client.HttpClient| Sending HTTP message to: 'http://localhost:8888/books'
19:47:14,081 DEBUG    client.HttpClient| Message to send:
{
  "author" : "Keanu Reeves",
  "title" : "The Matrix",
  "isbn" : "isbn2"
}
19:47:14,140 DEBUG ingClientInterceptor| Sending Http request message
19:47:14,140 DEBUG ingClientInterceptor| Sending Http request message
19:47:14,140 DEBUG ingClientInterceptor| Sending Http request message
19:47:14,294 DEBUG ingClientInterceptor| Received Http response message
19:47:14,294 DEBUG ingClientInterceptor| Received Http response message
19:47:14,294 DEBUG ingClientInterceptor| Received Http response message
19:47:14,297 INFO     client.HttpClient| HTTP message was sent to endpoint: 'http://localhost:8888/books'
19:47:14,297 INFO     client.HttpClient| HTTP message was sent to endpoint: 'http://localhost:8888/books'
19:47:14,297 INFO     client.HttpClient| HTTP message was sent to endpoint: 'http://localhost:8888/books'
19:47:14,299 DEBUG ltCorrelationManager| Saving correlated object for 'citrus_message_id = '3da81483-61c6-47e3-a818-31aded551f95''
19:47:14,299 DEBUG ltCorrelationManager| Saving correlated object for 'citrus_message_id = '83b9df8a-a1b2-46ad-a717-7968b90dd4a4''
19:47:14,299 DEBUG ltCorrelationManager| Saving correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:14,300 INFO  port.LoggingReporter| 
19:47:14,300 INFO  port.LoggingReporter| 
19:47:14,300 DEBUG port.LoggingReporter| TEST STEP 1 SUCCESS
19:47:14,300 INFO  port.LoggingReporter| 
19:47:14,300 DEBUG port.LoggingReporter| TEST STEP 2 SUCCESS
19:47:14,300 DEBUG port.LoggingReporter| TEST STEP 3 SUCCESS
19:47:14,303 INFO  port.LoggingReporter| 
19:47:14,303 INFO  port.LoggingReporter| 
19:47:14,303 INFO  port.LoggingReporter| 
19:47:14,304 DEBUG port.LoggingReporter| TEST STEP 4: receive
19:47:14,304 DEBUG port.LoggingReporter| TEST STEP 5: receive
19:47:14,303 DEBUG port.LoggingReporter| TEST STEP 0: receive
19:47:14,304 DEBUG ngCorrelationManager| Get correlation key for 'citrus_message_correlator_restApiClient'
19:47:14,304 DEBUG ngCorrelationManager| Get correlation key for 'citrus_message_correlator_restApiClient'
19:47:14,304 DEBUG ngCorrelationManager| Get correlation key for 'citrus_message_correlator_restApiClient'
19:47:14,305 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:14,305 DEBUG athVariableExtractor| Reading JSON elements with JSONPath
19:47:14,304 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:14,308 DEBUG   citrus.RetryLogger| Reply message did not arrive yet - retrying in 500ms
19:47:14,305 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:14,309 DEBUG   citrus.RetryLogger| Reply message did not arrive yet - retrying in 500ms
19:47:14,332 DEBUG athVariableExtractor| Evaluating JSONPath expression: $.id
19:47:14,340 DEBUG  context.TestContext| Setting variable: bookId with value: '6ed72bb4-c84e-4565-baab-1c4fa1f8b7fb'
19:47:14,342 DEBUG ageValidatorRegistry| Found 4 message validators for message type: JSON
19:47:14,342 DEBUG TextMessageValidator| Start JSON message validation ...
19:47:14,342 DEBUG TextMessageValidator| Received message:
HTTPMESSAGE [id: a19aade7-169b-44ac-8c21-3925c5be5177, payload: {"author":"John Snow","title":"Winter is coming","id":"6ed72bb4-c84e-4565-baab-1c4fa1f8b7fb"}][headers: {Transfer-Encoding=chunked, Server=Jetty(9.4.18.v20190429), contentType=application/json, Date=1584557234000, citrus_message_id=a19aade7-169b-44ac-8c21-3925c5be5177, citrus_message_timestamp=1584557234299, Content-Type=application/json, citrus_http_status_code=201, citrus_http_reason_phrase=CREATED, citrus_http_version=HTTP/1.1}]
19:47:14,343 DEBUG TextMessageValidator| Control message:
HTTPMESSAGE [id: 0749954a-6ce9-4eda-9419-2cf21571d5ee, payload: ][headers: {citrus_message_id=0749954a-6ce9-4eda-9419-2cf21571d5ee, citrus_message_timestamp=1584557234302, citrus_http_status_code=201, citrus_http_reason_phrase=CREATED, citrus_message_type=JSON}]
19:47:14,343 DEBUG TextMessageValidator| Skip message payload validation as no control message was defined
19:47:14,343 DEBUG ssageHeaderValidator| Start message header validation ...
19:47:14,350 DEBUG faultHeaderValidator| Validating header element: citrus_http_status_code='201': OK.
19:47:14,350 DEBUG faultHeaderValidator| Validating header element: citrus_http_reason_phrase='CREATED': OK.
19:47:14,350 INFO  ssageHeaderValidator| Message header validation successful: All values OK
19:47:14,350 INFO  port.LoggingReporter| 
19:47:14,351 DEBUG port.LoggingReporter| TEST STEP 5 SUCCESS
19:47:14,351 INFO  port.LoggingReporter| 
19:47:14,351 DEBUG port.LoggingReporter| TEST STEP 6: send
19:47:14,352 DEBUG ltCorrelationManager| Saving correlation key for 'citrus_message_correlator_restApiClient'
19:47:14,352 DEBUG  context.TestContext| Setting variable: citrus_message_correlator_restApiClient with value: 'citrus_message_id = '330f0939-0bec-46a4-b3c2-92a0c39bb3b9''
19:47:14,352 DEBUG    client.HttpClient| Sending HTTP message to: 'http://localhost:8888/books'
19:47:14,352 DEBUG    client.HttpClient| Message to send:

19:47:14,353 DEBUG ingClientInterceptor| Sending Http request message
19:47:14,359 DEBUG ingClientInterceptor| Received Http response message
19:47:14,360 INFO     client.HttpClient| HTTP message was sent to endpoint: 'http://localhost:8888/books'
19:47:14,360 DEBUG ltCorrelationManager| Saving correlated object for 'citrus_message_id = '330f0939-0bec-46a4-b3c2-92a0c39bb3b9''
19:47:14,360 INFO  port.LoggingReporter| 
19:47:14,360 DEBUG port.LoggingReporter| TEST STEP 6 SUCCESS
19:47:14,361 INFO  port.LoggingReporter| 
19:47:14,361 DEBUG port.LoggingReporter| TEST STEP 7: receive
19:47:14,361 DEBUG ngCorrelationManager| Get correlation key for 'citrus_message_correlator_restApiClient'
19:47:14,361 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = '330f0939-0bec-46a4-b3c2-92a0c39bb3b9''
19:47:14,363 DEBUG ageValidatorRegistry| Found 4 message validators for message type: JSON
19:47:14,363 DEBUG TextMessageValidator| Start JSON message validation ...
19:47:14,363 DEBUG TextMessageValidator| Received message:
HTTPMESSAGE [id: d2709d54-893b-4209-8f21-fecc5d729a2a, payload: {"books":[{"author":"John Snow","title":"Winter is coming","id":"6ed72bb4-c84e-4565-baab-1c4fa1f8b7fb"},{"author":"Keanu Reeves","title":"The Matrix","id":"3205b7eb-9669-4c7e-87b2-0468ed5ee831"},{"author":"Peter Jackson","title":"The Lord of The Rings","id":"a52e48d5-5edd-4671-9420-65b961fd95b8"}],"size":3}][headers: {Transfer-Encoding=chunked, Server=Jetty(9.4.18.v20190429), contentType=application/json, Date=1584557234000, citrus_message_id=d2709d54-893b-4209-8f21-fecc5d729a2a, citrus_message_timestamp=1584557234360, Content-Type=application/json, citrus_http_status_code=200, citrus_http_reason_phrase=OK, citrus_http_version=HTTP/1.1}]
19:47:14,364 DEBUG TextMessageValidator| Control message:
HTTPMESSAGE [id: 80f61464-bb68-4a4f-9fc5-6401c92879c0, payload: ][headers: {citrus_message_id=80f61464-bb68-4a4f-9fc5-6401c92879c0, citrus_message_timestamp=1584557234361, citrus_http_status_code=200, citrus_http_reason_phrase=OK, citrus_message_type=JSON}]
19:47:14,364 DEBUG TextMessageValidator| Skip message payload validation as no control message was defined
19:47:14,364 DEBUG PathMessageValidator| Start JSONPath element validation ...
19:47:14,367 DEBUG PathMessageValidator| Validating element: $.books='@contains('6ed72bb4-c84e-4565-baab-1c4fa1f8b7fb')@': OK.
19:47:14,367 INFO  PathMessageValidator| JSONPath element validation successful: All values OK
19:47:14,367 DEBUG ssageHeaderValidator| Start message header validation ...
19:47:14,367 DEBUG faultHeaderValidator| Validating header element: citrus_http_status_code='200': OK.
19:47:14,368 DEBUG faultHeaderValidator| Validating header element: citrus_http_reason_phrase='OK': OK.
19:47:14,368 INFO  ssageHeaderValidator| Message header validation successful: All values OK
19:47:14,368 INFO  port.LoggingReporter| 
19:47:14,368 DEBUG port.LoggingReporter| TEST STEP 7 SUCCESS
19:47:14,475 INFO  port.LoggingReporter| 
19:47:14,475 INFO  port.LoggingReporter| TEST SUCCESS AppTestIT.testTheApi (com.example)
19:47:14,475 INFO  port.LoggingReporter| ------------------------------------------------------------------------
19:47:14,475 INFO  port.LoggingReporter| 
19:47:14,809 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:14,809 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:14,810 DEBUG   citrus.RetryLogger| Reply message did not arrive yet - retrying in 500ms
19:47:14,810 DEBUG   citrus.RetryLogger| Reply message did not arrive yet - retrying in 500ms
19:47:15,310 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:15,311 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:15,311 DEBUG   citrus.RetryLogger| Reply message did not arrive yet - retrying in 500ms
19:47:15,311 DEBUG   citrus.RetryLogger| Reply message did not arrive yet - retrying in 500ms
19:47:15,812 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:15,812 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:15,813 DEBUG   citrus.RetryLogger| Reply message did not arrive yet - retrying in 500ms
19:47:15,812 DEBUG   citrus.RetryLogger| Reply message did not arrive yet - retrying in 500ms
19:47:16,313 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:16,314 DEBUG   citrus.RetryLogger| Reply message did not arrive yet - retrying in 500ms
19:47:16,314 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:16,314 DEBUG   citrus.RetryLogger| Reply message did not arrive yet - retrying in 500ms
19:47:16,814 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:16,815 DEBUG   citrus.RetryLogger| Reply message did not arrive yet - retrying in 500ms
19:47:16,815 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:16,815 DEBUG   citrus.RetryLogger| Reply message did not arrive yet - retrying in 500ms
19:47:17,315 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:17,316 DEBUG   citrus.RetryLogger| Reply message did not arrive yet - retrying in 500ms
19:47:17,316 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:17,317 DEBUG   citrus.RetryLogger| Reply message did not arrive yet - retrying in 500ms
19:47:17,816 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:17,817 DEBUG   citrus.RetryLogger| Reply message did not arrive yet - retrying in 500ms
19:47:17,817 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:17,818 DEBUG   citrus.RetryLogger| Reply message did not arrive yet - retrying in 500ms
19:47:18,318 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:18,318 DEBUG   citrus.RetryLogger| Reply message did not arrive yet - retrying in 500ms
19:47:18,318 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:18,319 DEBUG   citrus.RetryLogger| Reply message did not arrive yet - retrying in 500ms
19:47:18,819 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:18,819 DEBUG   citrus.RetryLogger| Reply message did not arrive yet - retrying in 500ms
19:47:18,819 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:18,820 DEBUG   citrus.RetryLogger| Reply message did not arrive yet - retrying in 500ms
19:47:19,320 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:19,320 DEBUG ltCorrelationManager| Finding correlated object for 'citrus_message_id = 'b1c1cbc8-6bb4-4f8c-9579-6bfd39a8511c''
19:47:19,337 DEBUG t.TestContextFactory| Created new test context - using global variables: '{}'
19:47:19,337 INFO  port.LoggingReporter| 
19:47:19,338 ERROR port.LoggingReporter| TEST FAILED AppTestIT.testTheApi <com.example> Nested exception is: 
com.consol.citrus.exceptions.TestCaseFailedException: Action timeout while receiving synchronous reply message from http server
        at com.consol.citrus.TestCase.executeAction(TestCase.java:227)
        at com.consol.citrus.dsl.runner.DefaultTestRunner.run(DefaultTestRunner.java:188)
        at com.consol.citrus.dsl.runner.DefaultTestRunner.http(DefaultTestRunner.java:540)
        at com.example.AppTestIT.testTheApi(AppTestIT.java:55)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:675)
        at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
        at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:125)
        at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:132)
        at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:124)
        at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestTemplateMethod(TimeoutExtension.java:81)
        at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
        at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
        at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:104)
        at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:62)
        at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:43)
        at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:35)
        at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
        at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
        at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:202)
        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
        at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:198)
        at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135)
        at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:69)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:135)
        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
        at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
        at org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService$ExclusiveTask.compute(ForkJoinPoolHierarchicalTestExecutorService.java:171)
        at java.util.concurrent.RecursiveAction.exec(RecursiveAction.java:189)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: com.consol.citrus.exceptions.ActionTimeoutException: Action timeout while receiving synchronous reply message from http server
        at com.consol.citrus.http.client.HttpClient.receive(HttpClient.java:166)
        at com.consol.citrus.http.client.HttpClient.receive(HttpClient.java:157)
        at com.consol.citrus.actions.ReceiveMessageAction.receive(ReceiveMessageAction.java:141)
        at com.consol.citrus.actions.ReceiveMessageAction.doExecute(ReceiveMessageAction.java:120)
        at com.consol.citrus.actions.AbstractTestAction.execute(AbstractTestAction.java:42)
        at com.consol.citrus.dsl.actions.DelegatingTestAction.doExecute(DelegatingTestAction.java:54)
        at com.consol.citrus.actions.AbstractTestAction.execute(AbstractTestAction.java:42)
        at com.consol.citrus.TestCase.executeAction(TestCase.java:220)
        ... 40 more
19:47:19,338 INFO  port.LoggingReporter| 
19:47:19,340 INFO  port.LoggingReporter| ------------------------------------------------------------------------
19:47:19,341 INFO  port.LoggingReporter| 
19:47:19,340 ERROR port.LoggingReporter| TEST FAILED AppTestIT.testTheApi <com.example> Nested exception is: 
com.consol.citrus.exceptions.TestCaseFailedException: Action timeout while receiving synchronous reply message from http server
        at com.consol.citrus.TestCase.executeAction(TestCase.java:227)
        at com.consol.citrus.dsl.runner.DefaultTestRunner.run(DefaultTestRunner.java:188)
        at com.consol.citrus.dsl.runner.DefaultTestRunner.http(DefaultTestRunner.java:540)
        at com.example.AppTestIT.testTheApi(AppTestIT.java:55)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:675)
        at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
        at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:125)
        at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:132)
        at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:124)
        at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestTemplateMethod(TimeoutExtension.java:81)
        at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
        at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
        at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:104)
        at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:62)
        at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:43)
        at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:35)
        at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
        at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
        at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:202)
        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
        at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:198)
        at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135)
        at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:69)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:135)
        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
        at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
        at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
        at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
        at org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService$ExclusiveTask.compute(ForkJoinPoolHierarchicalTestExecutorService.java:171)
        at java.util.concurrent.RecursiveAction.exec(RecursiveAction.java:189)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: com.consol.citrus.exceptions.ActionTimeoutException: Action timeout while receiving synchronous reply message from http server
        at com.consol.citrus.http.client.HttpClient.receive(HttpClient.java:166)
        at com.consol.citrus.http.client.HttpClient.receive(HttpClient.java:157)
        at com.consol.citrus.actions.ReceiveMessageAction.receive(ReceiveMessageAction.java:141)
        at com.consol.citrus.actions.ReceiveMessageAction.doExecute(ReceiveMessageAction.java:120)
        at com.consol.citrus.actions.AbstractTestAction.execute(AbstractTestAction.java:42)
        at com.consol.citrus.dsl.actions.DelegatingTestAction.doExecute(DelegatingTestAction.java:54)
        at com.consol.citrus.actions.AbstractTestAction.execute(AbstractTestAction.java:42)
        at com.consol.citrus.TestCase.executeAction(TestCase.java:220)
        ... 40 more
19:47:19,342 INFO  port.LoggingReporter| ------------------------------------------------------------------------
19:47:19,342 INFO  port.LoggingReporter| 
[ERROR] Tests run: 3, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 6.193 s <<< FAILURE! - in com.example.AppTestIT
[ERROR] com.example.AppTestIT.testTheApi(Book,String,TestRunner)  Time elapsed: 5.513 s  <<< ERROR!
com.consol.citrus.exceptions.TestCaseFailedException: Action timeout while receiving synchronous reply message from http server
        at com.example.AppTestIT.testTheApi(AppTestIT.java:55)
Caused by: com.consol.citrus.exceptions.ActionTimeoutException: Action timeout while receiving synchronous reply message from http server
        at com.example.AppTestIT.testTheApi(AppTestIT.java:55)

[ERROR] com.example.AppTestIT.testTheApi(Book,String,TestRunner)  Time elapsed: 5.511 s  <<< ERROR!
com.consol.citrus.exceptions.TestCaseFailedException: Action timeout while receiving synchronous reply message from http server
        at com.example.AppTestIT.testTheApi(AppTestIT.java:55)
Caused by: com.consol.citrus.exceptions.ActionTimeoutException: Action timeout while receiving synchronous reply message from http server
        at com.example.AppTestIT.testTheApi(AppTestIT.java:55)

I've also tried with JUnit 4 but it doesn't seem possible

@RunWith(Parameterized.class)
public class JUnit4TestIT extends JUnit4CitrusTest {

    private static final Logger LOGGER = LoggerFactory.getLogger(JUnit4TestIT.class);

    @Autowired
    private HttpClient restApiClient;

    @Parameters
    public static Collection<Object[]> data() {
        return Arrays.asList(new Object[][]{
                {
                    new Book("Peter Jackson", "The Lord of The Rings"), "isbn1"
                },
                {
                    new Book("Keanu Reeves", "The Matrix"), "isbn2"
                },
                {
                    new Book("John Snow", "Winter is coming"), "isbn3"
                }
            }
        );
    }

    @Parameter
    public Book book;
    @Parameter(1)
    public String isbn;

    // How to inject TestRunner / Test context into test method?
    private TestContext context;
    private TestRunner runner;


    @CitrusTest
    @Test
    public void testTheApi() {
        runner.http(httpActionBuilder -> httpActionBuilder
            .client(restApiClient)
            .send().post("/books")
            .payload(
                String.format(
                    "{\n"
                        + "  \"author\" : \"%s\",\n"
                        + "  \"title\" : \"%s\",\n"
                        + "  \"isbn\" : \"%s\"\n"
                        + "}", book.getAuthor(), book.getTitle(), isbn
                )).fork(true)            
        );

Additional information
Java 1.8
Maven 3.6.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant