From 62746d9d444f63154986604e3204e79b99b6e938 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 16 Nov 2022 20:57:07 +1000 Subject: [PATCH] review comments --- .../jetty/tests/hometester/JettyHomeTester.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/jetty-home-tester/src/main/java/org/eclipse/jetty/tests/hometester/JettyHomeTester.java b/tests/jetty-home-tester/src/main/java/org/eclipse/jetty/tests/hometester/JettyHomeTester.java index 3441a61cfb8..73ab0a96c4f 100644 --- a/tests/jetty-home-tester/src/main/java/org/eclipse/jetty/tests/hometester/JettyHomeTester.java +++ b/tests/jetty-home-tester/src/main/java/org/eclipse/jetty/tests/hometester/JettyHomeTester.java @@ -39,7 +39,6 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; import org.apache.maven.repository.internal.MavenRepositorySystemUtils; -import org.awaitility.Awaitility; import org.awaitility.core.ConditionTimeoutException; import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.StringUtils; @@ -68,6 +67,8 @@ import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import static org.awaitility.Awaitility.await; + /** *

Helper class to test the Jetty Distribution

. *

API can change without any further notice.

@@ -562,14 +563,13 @@ public class JettyHomeTester { try { - Awaitility.await().atMost(time, unit).until(() -> logs.stream().anyMatch(s -> s.contains(txt))); + await().atMost(time, unit).until(() -> logs.stream().anyMatch(s -> s.contains(txt))); return true; } catch (ConditionTimeoutException e) { - // nothing + return false; } - return false; } /** @@ -589,18 +589,17 @@ public class JettyHomeTester thread.start(); try { - Awaitility.await().atMost(time, unit).until(() -> logs.stream().anyMatch(s -> s.contains(txt))); + await().atMost(time, unit).until(() -> logs.stream().anyMatch(s -> s.contains(txt))); return true; } catch (ConditionTimeoutException e) { - // nothing + return false; } finally { logFileStreamer.stop(); } - return false; } /**