Echoでコマンドの実装をテスト

This commit is contained in:
ろむねこ 2024-06-11 16:44:21 +09:00
parent 123fdfdcc8
commit 02ba8d7439
Signed by: Fujimatsu
GPG Key ID: FA1F39A1BA37D168

View File

@ -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() {