Echoでコマンドの実装をテスト
This commit is contained in:
parent
123fdfdcc8
commit
02ba8d7439
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user