#11655 use awaitility to assert as the queue could be updated after the response was received by the client

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
This commit is contained in:
Ludovic Orban 2024-04-16 16:36:19 +02:00
parent dc0cd2d45f
commit 940c7440b4
1 changed files with 2 additions and 1 deletions

View File

@ -37,6 +37,7 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;
import static org.awaitility.Awaitility.await;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains;
import static org.hamcrest.Matchers.containsString;
@ -112,7 +113,7 @@ public class RequestListenersTest
"""));
assertEquals(HttpStatus.OK_200, response.getStatus());
assertThat(history, contains("zero", "one", "two", "three", "four"));
await().atMost(5, TimeUnit.SECONDS).until(() -> history, contains("zero", "one", "two", "three", "four"));
}
@Test