@Test public void testInvalidNames() { final String[] invalidNames = {"", " ", null}; for (final String name : invalidNames) { final GroupNameRule rule = new GroupNameRule(name); assertFalse(rule.isValid()); try { rule.validate(); } catch (final BadRequestException bre) { assertTrue(true); } } }
@Override public void validate() throws BadRequestException { if (!isValid()) { throw new BadRequestException(getMessageResponseStatus(), getMessage()); } }
GroupNameRule extends ValidNameRule { @Override public void validate() throws BadRequestException { if (!isValid()) { throw new BadRequestException(getMessageResponseStatus(), getMessage()); } } }
GroupNameRule extends ValidNameRule { @Override public void validate() throws BadRequestException { if (!isValid()) { throw new BadRequestException(getMessageResponseStatus(), getMessage()); } } GroupNameRule(final String theName); }
GroupNameRule extends ValidNameRule { @Override public void validate() throws BadRequestException { if (!isValid()) { throw new BadRequestException(getMessageResponseStatus(), getMessage()); } } GroupNameRule(final String theName); @Override void validate(); }
GroupNameRule extends ValidNameRule { @Override public void validate() throws BadRequestException { if (!isValid()) { throw new BadRequestException(getMessageResponseStatus(), getMessage()); } } GroupNameRule(final String theName); @Override void validate();  }