urn_perun_user_attribute_def_def_osbIddc2 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, "ID from DC2 can't be null."); }  @Override void checkAttributeSemantics(PerunSessionImpl sess, User user, Attribute attribute); @Override AttributeDefinition getAttributeDefinition();  }
@Test(expected = WrongReferenceAttributeValueException.class) public void testCheckAttributeWithNullValue() throws Exception { System.out.println("testCheckAttributeWithNullValue()"); attributeToCheck.setValue(null); classInstance.checkAttributeSemantics(session, user, attributeToCheck); }
@Test public void testCheckCorrectSemantics() throws Exception { System.out.println("testCheckCorrectSemantics()"); attributeToCheck.setValue("my_example"); classInstance.checkAttributeSemantics(session, user, attributeToCheck); }