urn_perun_group_attribute_def_def_uniqueID extends GroupAttributesModuleAbstract implements GroupAttributesModuleImplApi { @Override public Attribute fillAttribute(PerunSessionImpl session, Group group, AttributeDefinition attribute) throws WrongAttributeAssignmentException { Attribute filledAttribute = new Attribute(attribute); filledAttribute.setValue(sha1HashCount(group).toString()); return filledAttribute; }  @Override Attribute fillAttribute(PerunSessionImpl session, Group group, AttributeDefinition attribute); @Override AttributeDefinition getAttributeDefinition();  }
@Test public void testFillValue() throws Exception { System.out.println("testCorrectFilling()"); Attribute filledAttribute1 = classInstance.fillAttribute(sess, group1, attributeToCheck); assertNotNull("expected not null filled attribute", filledAttribute1); assertNotNull("expected not null value of filled attribute", filledAttribute1.getValue()); Matcher matcher = pattern.matcher(filledAttribute1.valueAsString()); assertTrue("expected matching for regular expression", matcher.matches()); Attribute filledAttribute2 = classInstance.fillAttribute(sess, group2, attributeToCheck); assertNotNull("expected not null filled attribute", filledAttribute2); assertNotNull("expected not null value of filled attribute", filledAttribute2.getValue()); matcher = pattern.matcher(filledAttribute2.valueAsString()); assertTrue("expected matching for regular expression", matcher.matches()); assertTrue("expected different output for 2 different groups", filledAttribute1.getValue() != filledAttribute2.getValue()); assertEquals("expected the same output for the same group", filledAttribute1, classInstance.fillAttribute(sess, group1, attributeToCheck)); }