@Test public void emptyInputShouldProperlyFail() throws Exception { String subject = "subject"; String input = ""; ValidationResult result = eventTypeValidator.validate(subject, input, context); assertEquals("subject", result.getSubject()); assertEquals("", result.getInput()); assertEquals("Empty event types are not allowed.", result.getExplanation()); assertFalse(result.isValid()); }
@Override public ValidationResult validate(String subject, String input, ValidationContext context) { final String explanation = isValidEventType(input); return new ValidationResult.Builder() .subject(subject) .input(input) .valid(explanation == null) .explanation(explanation) .build(); }
EventTypeValidator implements Validator { @Override public ValidationResult validate(String subject, String input, ValidationContext context) { final String explanation = isValidEventType(input); return new ValidationResult.Builder() .subject(subject) .input(input) .valid(explanation == null) .explanation(explanation) .build(); } }
EventTypeValidator implements Validator { @Override public ValidationResult validate(String subject, String input, ValidationContext context) { final String explanation = isValidEventType(input); return new ValidationResult.Builder() .subject(subject) .input(input) .valid(explanation == null) .explanation(explanation) .build(); }  }
EventTypeValidator implements Validator { @Override public ValidationResult validate(String subject, String input, ValidationContext context) { final String explanation = isValidEventType(input); return new ValidationResult.Builder() .subject(subject) .input(input) .valid(explanation == null) .explanation(explanation) .build(); }  @Override ValidationResult validate(String subject, String input, ValidationContext context); }
EventTypeValidator implements Validator { @Override public ValidationResult validate(String subject, String input, ValidationContext context) { final String explanation = isValidEventType(input); return new ValidationResult.Builder() .subject(subject) .input(input) .valid(explanation == null) .explanation(explanation) .build(); }  @Override ValidationResult validate(String subject, String input, ValidationContext context);  }