@Test public void testInvalidNames() { final String[] invalidNames = {"", " ", null, "65charactersNameHereCheckforInvalidity123456789101112131415161718"}; for (final String name : invalidNames) { final JvmNameRule rule = new JvmNameRule(name); assertFalse(rule.isValid()); try { rule.validate(); } catch (final BadRequestException bre) { assertTrue(true); } } }
@Override public boolean isValid() { return super.isValid() && name.length() <= MAX_LENGTH; }
JvmNameRule extends ValidNameRule { @Override public boolean isValid() { return super.isValid() && name.length() <= MAX_LENGTH; } }
JvmNameRule extends ValidNameRule { @Override public boolean isValid() { return super.isValid() && name.length() <= MAX_LENGTH; } JvmNameRule(final String theName); }
JvmNameRule extends ValidNameRule { @Override public boolean isValid() { return super.isValid() && name.length() <= MAX_LENGTH; } JvmNameRule(final String theName); @Override boolean isValid(); }
JvmNameRule extends ValidNameRule { @Override public boolean isValid() { return super.isValid() && name.length() <= MAX_LENGTH; } JvmNameRule(final String theName); @Override boolean isValid(); final int MAX_LENGTH; }