From dd9c92385c813d0477b61ed3c8bfda1ee78d082b Mon Sep 17 00:00:00 2001 From: Benedikt Fein Date: Sat, 14 Oct 2023 14:19:53 +0200 Subject: [PATCH] Programming exercises: Fix failing example test in Java blackbox exercise template (#7365) --- .../solution/src/${packageNameFolder}/Client.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/resources/templates/java/maven_blackbox/solution/src/${packageNameFolder}/Client.java b/src/main/resources/templates/java/maven_blackbox/solution/src/${packageNameFolder}/Client.java index d2bb7a3b8799..38c971afe5dd 100644 --- a/src/main/resources/templates/java/maven_blackbox/solution/src/${packageNameFolder}/Client.java +++ b/src/main/resources/templates/java/maven_blackbox/solution/src/${packageNameFolder}/Client.java @@ -38,11 +38,17 @@ public static void main(String[] args) throws IOException { private static CommandRunResult runCommand(final Command command) { switch (command) { - case Command.AddCommand addCommand -> CONTEXT.addDates(addCommand.dates()); + case Command.AddCommand addCommand -> { + CONTEXT.addDates(addCommand.dates()); + } case Command.SortCommand ignored -> CONTEXT.sort(); case Command.ClearCommand ignored -> CONTEXT.clearDates(); - case Command.HelpCommand helpCommand -> System.out.println(helpCommand.helpMessage()); - case Command.PrintCommand ignored -> System.out.println(CONTEXT.getDates()); + case Command.HelpCommand helpCommand -> { + System.out.println(helpCommand.helpMessage()); + } + case Command.PrintCommand ignored -> { + System.out.println(CONTEXT.getDates()); + } case Command.QuitCommand ignored -> { return CommandRunResult.QUIT; }