Problems with running integration tests en masse #3674
-
I have a few integration tests written that are testing 3 different flows, some with tests for subflows. They all work fine when run in isolation within my IDE. When they're run en masse I get errors in the tests that appear to be because the mocks aren't replacing the actual implementation:
The tests are all annotated similarly to the following
What could I be doing improperly to where my mocks aren't replaced properly when doing the following? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 40 replies
-
Sorry, not enough info. Or at least show your flows and what you do in the tests. |
Beta Was this translation helpful? Give feedback.
-
Sorry, my mistake, it automatically starts the outbound endpoint. You're correct. If you look at my test from this link #3674 (reply in thread) It fails on this line If I remove the call to start the endpoint, the test fails due to the assertion that the endpoint is running regardless of how the test is executed; individually or in the integration test suite.
When I remove the guts of the process flow to where it's just taking from one queue to the next, the only assertions that fail when I run the test individually are the ones related to the things that were removed from the flow. The mock handler is still attached and the message is still captured. |
Beta Was this translation helpful? Give feedback.
Sorry, my mistake, it automatically starts the outbound endpoint. You're correct.
If you look at my test from this link #3674 (reply in thread)
you'll see an assertion that the endpoint is stopped on the first line of code in the method. The test doesn't fail on that line. You'll also see an assertion that the endpoint has started after I've manually started it. It doesn't fail on that assertion.
It fails on this line
verify(messageHandler, timeout(5000)).handleMessage(any());
The console output during the test shows it removing the actual handler and adding the mock handler but the mock handler doesn't get the call, it goes to the actual handler.If I remove the call to start the endpoin…