Making the RESTLoggingTest more robust
@@ -74,6 +74,8 @@ public class RESTLoggingTest {
server.stop();
server.destroy();
+ Assert.assertEquals(8, events.size());
+
// First call with binary logging false
assertContentLogged(events.get(0));
assertContentLogged(events.get(1));
@@ -98,8 +100,12 @@ public class RESTLoggingTest {
WebClient client = createClient(SERVICE_URI, loggingFeature);
String result = client.get(String.class);
Assert.assertEquals("test1", result);
- server.destroy();
+
List<LogEvent> events = sender.getEvents();
+ await().until(() -> events.size(), is(4));
+ server.stop();
+ server.destroy();
+
Assert.assertEquals(4, events.size());
checkRequestOut(events.get(0));
checkRequestIn(events.get(1));
