urn_perun_user_attribute_def_def_ucoVsup 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, "UČO can't be null."); }  @Override void checkAttributeSemantics(PerunSessionImpl sess, User user, Attribute attribute); @Override Attribute fillAttribute(PerunSessionImpl sess, User user, AttributeDefinition attribute); @Override void changedAttributeHook(PerunSessionImpl session, User user, Attribute attribute); @Override AttributeDefinition getAttributeDefinition();  }
@Test public void testCheckCorrectAttributeSemantics() throws Exception { System.out.println("testCheckCorrectAttributeSemantics()"); Attribute attributeToCheck = new Attribute(); attributeToCheck.setValue("not_null"); classInstance.checkAttributeSemantics(session, user, attributeToCheck); }
@Test(expected = WrongReferenceAttributeValueException.class) public void testCheckAttributeSemanticsWithNullValue() throws Exception { System.out.println("testCheckAttributeSemanticsWithNullValue()"); Attribute attributeToCheck = new Attribute(); attributeToCheck.setValue(null); classInstance.checkAttributeSemantics(session, user, attributeToCheck); }