urn_perun_user_attribute_def_virt_loa extends UserVirtualAttributesModuleAbstract implements UserVirtualAttributesModuleImplApi { @Override public void checkAttributeSemantics(PerunSessionImpl sess, User user, Attribute attribute) throws WrongReferenceAttributeValueException { if(attribute.getValue() == null) throw new WrongReferenceAttributeValueException(attribute, null, user, null, "Attribute value is null."); }  @Override void checkAttributeSemantics(PerunSessionImpl sess, User user, Attribute attribute); @Override Attribute getAttributeValue(PerunSessionImpl sess, User user, AttributeDefinition attributeDefinition); @Override AttributeDefinition getAttributeDefinition(); @Override List<AuditEvent> resolveVirtualAttributeValueChange(PerunSessionImpl sess, AuditEvent message);  }
@Test(expected = WrongReferenceAttributeValueException.class) public void testSemanticsWithNullValue() throws Exception { System.out.println("testSemanticsWithNullValue()"); attributeToCheck.setValue(null); classInstance.checkAttributeSemantics(session, user, attributeToCheck); }
@Test public void testCorrectSemantics() throws Exception { System.out.println("testCorrectSemantics()"); attributeToCheck.setValue("5"); classInstance.checkAttributeSemantics(session, user, attributeToCheck); }