urn_perun_group_attribute_def_def_groupStructureResources extends GroupAttributesModuleAbstract implements GroupAttributesModuleImplApi { @Override public void checkAttributeSyntax(PerunSessionImpl sess, Group group, Attribute attribute) throws WrongAttributeValueException { if(attribute.getValue() == null) return; LinkedHashMap<String, String> attrValues = attribute.valueAsMap(); boolean hasInvalidResourceName = attrValues.keySet().stream() .anyMatch(this::invalidResourceName); if (hasInvalidResourceName) { throw new WrongAttributeValueException(attribute, group, "Some of the specified resource ids has an invalid format."); } for (String rawGroupLogins : attrValues.values()) { if (rawGroupLogins == null || rawGroupLogins.isEmpty()) { continue; } Matcher m = invalidEscapePattern.matcher(rawGroupLogins); if (m.find()) { throw new WrongAttributeValueException(attribute, group, "Group logins format contains invalid escape sequence."); } if (!rawGroupLogins.endsWith(",")) { throw new WrongAttributeValueException(attribute, group, "Each group login has to end with a comma ','."); } } }  @Override void checkAttributeSyntax(PerunSessionImpl sess, Group group, Attribute attribute); @Override void checkAttributeSemantics(PerunSessionImpl sess, Group group, Attribute attribute); @Override AttributeDefinition getAttributeDefinition();  }
@Test public void testNullValueIsValidInSyntax() throws Exception { System.out.println(CLASS_NAME + "testNullValueIsValidInSyntax"); attribute.setValue(null); classInstance.checkAttributeSyntax(sess, group, attribute); }