Slackbot
03/13/2023, 1:39 PMPaul Petershagen
03/14/2023, 3:35 AMAwaitility.await().pollDelay(Durations.TWO_SECONDS).untilAsserted(() -> {
wireMockServer.verify(1, getRequestedFor(urlMatching(
String.format("{url}", userId))));
wireMockServer.verify(0, postRequestedFor(urlMatching(
"{url}")));
});
It will wait until the assertions don't throw an exception. You might also want to add an .atMost(...)
, to change the max runtime for the await()
. But if in that time frame the unit under test sends two requests, then that is its behavior, then double check the prod code is doing the right thing.Paul Petershagen
03/14/2023, 3:39 AMurlMatching
statement if that is right, not sure if you have modified it for this post here.Sheetal Jain
03/14/2023, 6:24 AMurlMatching
. Let me make the changes that you have suggested then I'll let you know.Sheetal Jain
03/14/2023, 6:31 AMawait() statement
to what you have suggested? Like where is the problem.Sheetal Jain
03/14/2023, 6:37 AMorg.awaitility.core.ConditionTimeoutException: Assertion condition defined as a lambda expression in co.tala.atlas.promotions.integration.kafka.consumer.SignUpEventConsumerTest Expected exactly 1 requests matching the following pattern but received 2:
Paul Petershagen
03/14/2023, 6:41 AMPaul Petershagen
03/14/2023, 6:43 AMSheetal Jain
03/14/2023, 6:45 AMPaul Petershagen
03/14/2023, 6:48 AMSheetal Jain
03/14/2023, 6:48 AMSheetal Jain
03/22/2023, 8:57 AMSheetal Jain
03/22/2023, 10:06 AMcom.github.tomakehurst.wiremock.client.VerificationException: Expected exactly 1 requests matching the following pattern but received 2:
{
"urlPattern" : "/users/customer/profiles/844424930132106",
"method" : "GET"
}
at com.github.tomakehurst.wiremock.client.WireMock.verifyThat(WireMock.java:538)
at com.github.tomakehurst.wiremock.client.WireMock.verifyThat(WireMock.java:521)
at com.github.tomakehurst.wiremock.WireMockServer.verify(WireMockServer.java:271)
at
Sheetal Jain
03/22/2023, 12:52 PM