urn_perun_user_attribute_def_def_preferredMail 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, "User preferred mail can't be set to null."); }  @Override void checkAttributeSyntax(PerunSessionImpl sess, User user, Attribute attribute); @Override void checkAttributeSemantics(PerunSessionImpl sess, User user, Attribute attribute); @Override AttributeDefinition getAttributeDefinition();  }
@Test(expected = WrongReferenceAttributeValueException.class) public void testCheckSemanticsWithNullAttributeValue() throws Exception { System.out.println("testCheckSemanticsWithNullAttributeValue()"); classInstance.checkAttributeSemantics(session, user, attributeToCheck); }
@Test public void testCheckAttributeSemantics() throws Exception { System.out.println("testCheckAttributeSemantics()"); attributeToCheck.setValue("my@example.com"); classInstance.checkAttributeSemantics(session, user, attributeToCheck); }