@Test public void undefinedLdapGroupType() { AcmGroup acmGroup = new AcmGroup(); acmGroup.setName("ACM_ADMINISTATOR_DEV@ARMEDIA.COM"); acmGroup.setType(null); boolean res = unit.isValid(acmGroup, null); assertFalse(res); }
@Override public boolean isValid(AcmGroup acmGroup, ConstraintValidatorContext context) { if (acmGroup == null) { return false; } AcmGroupType groupType = acmGroup.getType(); String groupName = acmGroup.getName(); if (groupType == null) { return false; } if (groupType.equals(AcmGroupType.LDAP_GROUP)) { if (groupName.length() > 64) { return false; } } return true; }
LdapGroupNameValidator implements ConstraintValidator<LdapGroupNameValidation, AcmGroup> { @Override public boolean isValid(AcmGroup acmGroup, ConstraintValidatorContext context) { if (acmGroup == null) { return false; } AcmGroupType groupType = acmGroup.getType(); String groupName = acmGroup.getName(); if (groupType == null) { return false; } if (groupType.equals(AcmGroupType.LDAP_GROUP)) { if (groupName.length() > 64) { return false; } } return true; } }
LdapGroupNameValidator implements ConstraintValidator<LdapGroupNameValidation, AcmGroup> { @Override public boolean isValid(AcmGroup acmGroup, ConstraintValidatorContext context) { if (acmGroup == null) { return false; } AcmGroupType groupType = acmGroup.getType(); String groupName = acmGroup.getName(); if (groupType == null) { return false; } if (groupType.equals(AcmGroupType.LDAP_GROUP)) { if (groupName.length() > 64) { return false; } } return true; }  }
LdapGroupNameValidator implements ConstraintValidator<LdapGroupNameValidation, AcmGroup> { @Override public boolean isValid(AcmGroup acmGroup, ConstraintValidatorContext context) { if (acmGroup == null) { return false; } AcmGroupType groupType = acmGroup.getType(); String groupName = acmGroup.getName(); if (groupType == null) { return false; } if (groupType.equals(AcmGroupType.LDAP_GROUP)) { if (groupName.length() > 64) { return false; } } return true; }  @Override void initialize(LdapGroupNameValidation ldapGroupNameValidation); @Override boolean isValid(AcmGroup acmGroup, ConstraintValidatorContext context); }
LdapGroupNameValidator implements ConstraintValidator<LdapGroupNameValidation, AcmGroup> { @Override public boolean isValid(AcmGroup acmGroup, ConstraintValidatorContext context) { if (acmGroup == null) { return false; } AcmGroupType groupType = acmGroup.getType(); String groupName = acmGroup.getName(); if (groupType == null) { return false; } if (groupType.equals(AcmGroupType.LDAP_GROUP)) { if (groupName.length() > 64) { return false; } } return true; }  @Override void initialize(LdapGroupNameValidation ldapGroupNameValidation); @Override boolean isValid(AcmGroup acmGroup, ConstraintValidatorContext context);  }