From 02ba8d7439c9f58c38d313183bcaae5032662acb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Tue, 11 Jun 2024 16:44:21 +0900 Subject: [PATCH] =?UTF-8?q?Echo=E3=81=A7=E3=82=B3=E3=83=9E=E3=83=B3?= =?UTF-8?q?=E3=83=89=E3=81=AE=E5=AE=9F=E8=A3=85=E3=82=92=E3=83=86=E3=82=B9?= =?UTF-8?q?=E3=83=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nem/kidshift/feature/debug/DebugCommandProcessor.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/feature/debug/src/main/java/one/nem/kidshift/feature/debug/DebugCommandProcessor.java b/feature/debug/src/main/java/one/nem/kidshift/feature/debug/DebugCommandProcessor.java index ccdc727..537e680 100644 --- a/feature/debug/src/main/java/one/nem/kidshift/feature/debug/DebugCommandProcessor.java +++ b/feature/debug/src/main/java/one/nem/kidshift/feature/debug/DebugCommandProcessor.java @@ -24,12 +24,17 @@ public class DebugCommandProcessor { case "ping": return "pong"; case "echo": - return commandArray[1]; + return executeEcho(commandArray); default: throw new InvalidCommandException(); } } + private String executeEcho(String[] commandArray) { + // 結合して返す + return String.join(" ", commandArray); + } + // Exceptions private static class InvalidCommandException extends Exception { public InvalidCommandException() {