urn_perun_user_attribute_def_def_phone extends UserAttributesModuleAbstract implements UserAttributesModuleImplApi { @Override public void checkAttributeSemantics(PerunSessionImpl perunSession, User user, Attribute attribute) throws WrongReferenceAttributeValueException { if (attribute.getValue() == null) throw new WrongReferenceAttributeValueException(attribute, "User attribute phone cannot be null."); }  @Override void checkAttributeSyntax(PerunSessionImpl perunSession, User user, Attribute attribute); @Override void checkAttributeSemantics(PerunSessionImpl perunSession, User user, Attribute 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()"); attributeToCheck.setValue("+420123456789"); classInstance.checkAttributeSemantics(session, user, attributeToCheck); }