urn_perun_user_attribute_def_def_kerberosLogins extends UserAttributesModuleAbstract implements UserAttributesModuleImplApi { @Override public void checkAttributeSemantics(PerunSessionImpl sess, User user, Attribute attribute) throws WrongReferenceAttributeValueException { if(attribute.getValue() == null) throw new WrongReferenceAttributeValueException(attribute, null, user, null, "Attribute's value can't be null."); }  @Override void checkAttributeSyntax(PerunSessionImpl sess, User user, Attribute attribute); @Override void checkAttributeSemantics(PerunSessionImpl sess, User user, Attribute attribute); @Override Attribute fillAttribute(PerunSessionImpl sess, User user, AttributeDefinition attribute); @Override AttributeDefinition getAttributeDefinition();  }
@Test(expected = WrongReferenceAttributeValueException.class) public void testNullValue() throws Exception { System.out.println("testNullValue()"); attributeToCheck.setValue(null); classInstance.checkAttributeSemantics(session, user, attributeToCheck); }
@Test public void testCorrectSemantics() throws Exception { System.out.println("testCorrectSemantics()"); List<String> value = new ArrayList<>(); value.add("my@example"); attributeToCheck.setValue(value); classInstance.checkAttributeSemantics(session, user, attributeToCheck); }