use of cz.metacentrum.perun.core.api.RichResource in project perun by CESNET.
the class FacilitiesManagerEntryIntegrationTest method getAssignedRichResources.
@Test
public void getAssignedRichResources() throws Exception {
System.out.println(CLASS_NAME + "getAssignedRichResources");
Vo vo = setUpVo();
Resource resource = setUpResource(vo);
RichResource rresource = new RichResource(resource);
rresource.setVo(perun.getResourcesManager().getVo(sess, resource));
List<RichResource> assignedResources = perun.getFacilitiesManager().getAssignedRichResources(sess, facility);
List<Vo> vos = new ArrayList<Vo>();
for (RichResource rr : assignedResources) {
assertTrue("RichResource must have VO value filled", rr.getVo() != null);
vos.add(rr.getVo());
}
assertTrue("Our VO must be between RichResources VOs", vos.contains(vo));
assertTrue("our facility should have 1 assigned Resource", assignedResources.size() == 1);
assertTrue("our facility should have our Resource assigned", assignedResources.contains(rresource));
}
Aggregations