urn_perun_entityless_attribute_def_def_nonAuthzPwdResetMailTemplate_namespace extends EntitylessAttributesModuleAbstract { @Override public void checkAttributeSyntax(PerunSessionImpl perunSession, String key, Attribute attribute) throws WrongAttributeValueException { if (attribute.getValue() == null) return; if (!attribute.valueAsString().contains("{link}")) { throw new WrongAttributeValueException(attribute, key, "value doesn't contain contain tag {link}"); } }  @Override void checkAttributeSyntax(PerunSessionImpl perunSession, String key, Attribute attribute);  }
@Test(expected = WrongAttributeValueException.class) public void testCheckValueWithMissingTag() throws Exception { System.out.println("testCheckValueWithMissingTag()"); attributeToCheck.setValue("value"); classInstance.checkAttributeSyntax(session, "key", attributeToCheck); }
@Test public void testCorrectSyntax() throws Exception { System.out.println("testCorrectSyntax()"); attributeToCheck.setValue("{link}"); classInstance.checkAttributeSyntax(session, "key", attributeToCheck); }