From f3b8bf3de18b1ad1e013578205a28ed23d8452a8 Mon Sep 17 00:00:00 2001 From: Janne Valkealahti Date: Sat, 21 Oct 2023 09:03:01 +0100 Subject: [PATCH] Make ShellTestIntegrationTests more reliable - Temp workaround for letting tests pass - Relates #899 --- .../test/autoconfigure/ShellTestIntegrationTests.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spring-shell-test-autoconfigure/src/test/java/org/springframework/shell/test/autoconfigure/ShellTestIntegrationTests.java b/spring-shell-test-autoconfigure/src/test/java/org/springframework/shell/test/autoconfigure/ShellTestIntegrationTests.java index 5cf75c8c..d17aa502 100644 --- a/spring-shell-test-autoconfigure/src/test/java/org/springframework/shell/test/autoconfigure/ShellTestIntegrationTests.java +++ b/spring-shell-test-autoconfigure/src/test/java/org/springframework/shell/test/autoconfigure/ShellTestIntegrationTests.java @@ -97,6 +97,9 @@ public class ShellTestIntegrationTests { Condition helpHelpCondition = new Condition<>(line -> line.contains("help - Display help about available commands"), "Help help has expected output"); + Condition emptyCondition = new Condition<>(line -> line.trim().length() == 0, + "Have only whitespace"); + NonInteractiveShellSession session = client.nonInterative("help").run(); await().atMost(30, TimeUnit.SECONDS).untilAsserted(() -> { @@ -106,6 +109,12 @@ public class ShellTestIntegrationTests { }); session.write(session.writeSequence().clearScreen().build()); + // TODO: gh899 + await().atMost(30, TimeUnit.SECONDS).untilAsserted(() -> { + List lines = session.screen().lines(); + assertThat(lines).are(emptyCondition); + }); + NonInteractiveShellSession session2 = client.nonInterative("help", "help").run(); await().atMost(30, TimeUnit.SECONDS).untilAsserted(() -> { List lines = session2.screen().lines();