@Test public void message_contains_candidate() { assertThat(exception.getMessage(), containsString(candidate)); }
@Override public String getMessage() { StringBuilder sb = new StringBuilder(); sb .append("An unknown mode was found in the command line arguments: `") .append(candidate) .append("`.\n\n") .append("The possible choices are (they are case-sensitive):\n"); for (Object e : modeClass.getEnumConstants()) { sb .append("\t- ") .append(e) .append("\n"); } return sb.toString(); }
UnknownModeException extends RuntimeException { @Override public String getMessage() { StringBuilder sb = new StringBuilder(); sb .append("An unknown mode was found in the command line arguments: `") .append(candidate) .append("`.\n\n") .append("The possible choices are (they are case-sensitive):\n"); for (Object e : modeClass.getEnumConstants()) { sb .append("\t- ") .append(e) .append("\n"); } return sb.toString(); } }
UnknownModeException extends RuntimeException { @Override public String getMessage() { StringBuilder sb = new StringBuilder(); sb .append("An unknown mode was found in the command line arguments: `") .append(candidate) .append("`.\n\n") .append("The possible choices are (they are case-sensitive):\n"); for (Object e : modeClass.getEnumConstants()) { sb .append("\t- ") .append(e) .append("\n"); } return sb.toString(); } UnknownModeException(
            Class modeClass,
            String candidate); }
UnknownModeException extends RuntimeException { @Override public String getMessage() { StringBuilder sb = new StringBuilder(); sb .append("An unknown mode was found in the command line arguments: `") .append(candidate) .append("`.\n\n") .append("The possible choices are (they are case-sensitive):\n"); for (Object e : modeClass.getEnumConstants()) { sb .append("\t- ") .append(e) .append("\n"); } return sb.toString(); } UnknownModeException(
            Class modeClass,
            String candidate); @Override String getMessage(); }
UnknownModeException extends RuntimeException { @Override public String getMessage() { StringBuilder sb = new StringBuilder(); sb .append("An unknown mode was found in the command line arguments: `") .append(candidate) .append("`.\n\n") .append("The possible choices are (they are case-sensitive):\n"); for (Object e : modeClass.getEnumConstants()) { sb .append("\t- ") .append(e) .append("\n"); } return sb.toString(); } UnknownModeException(
            Class modeClass,
            String candidate); @Override String getMessage();  }