You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have some APIs where we only need to hit one external api and the format is as below. However there are also cases when we need to hit a couple more external services.
How to maintain sequence in those cases? One call after another repeating the mock as well as actual hitting the controller API?
@Test
public void testSomething() throws Exception {
mocoServer.request(endsWith(uri("/sample-endpoint")))
.response(with(sampleResponse), status(STATUS_CODE_200), header(contentType ,contentTypeJsonUtf));
running(mocoServer, () -> {
//Test case fails without the below delay
TimeUnit.SECONDS.sleep(2);
Response svResponse = restAssuredAssistantAPIPOST(STATUS_CODE_400, dataUrl,
dataHappyRequestBody);
assertEquals(STATUS_CODE_400, svResponse.getStatusCode());
});
}
The text was updated successfully, but these errors were encountered:
We have some APIs where we only need to hit one external api and the format is as below. However there are also cases when we need to hit a couple more external services.
How to maintain sequence in those cases? One call after another repeating the mock as well as actual hitting the controller API?
The text was updated successfully, but these errors were encountered: