urn_perun_resource_attribute_def_def_shells extends ResourceAttributesModuleAbstract implements ResourceAttributesModuleImplApi { @Override public Attribute fillAttribute(PerunSessionImpl perunSession, Resource resource, AttributeDefinition attribute) throws WrongAttributeAssignmentException { Attribute atr = new Attribute(attribute); Facility facility = perunSession.getPerunBl().getResourcesManagerBl().getFacility(perunSession, resource); Attribute allShellsPerFacility; try { allShellsPerFacility = perunSession.getPerunBl().getAttributesManagerBl().getAttribute(perunSession, facility, A_F_shells); } catch (AttributeNotExistsException ex) { throw new InternalErrorException("Attribute with list of shells from facility " + facility.getId() +" could not obtained.",ex); } atr.setValue(allShellsPerFacility.getValue()); return atr; }  @Override Attribute fillAttribute(PerunSessionImpl perunSession, Resource resource, AttributeDefinition attribute); @Override void checkAttributeSyntax(PerunSessionImpl perunSession, Resource resource, Attribute attribute); @Override void checkAttributeSemantics(PerunSessionImpl perunSession, Resource resource, Attribute attribute); @Override List<String> getDependencies(); @Override AttributeDefinition getAttributeDefinition();  }
@Test public void testFillAttribute() throws Exception { System.out.println("testFillAttribute()"); when(session.getPerunBl().getAttributesManagerBl().getAttribute(any(PerunSession.class), any(Facility.class), anyString())).thenReturn(listOfShells); final Attribute result = classInstance.fillAttribute(session, new Resource(), new AttributeDefinition()); assertEquals("fillAttribute has filled different shells than expected", listOfShells, result); }