PrivilegeManagementServiceImpl implements PrivilegeManagementService { @Override public void appendResources(final List<BaseResource> resources) { ZoneEntity zone = this.zoneResolver.getZoneEntityOrFail(); if (CollectionUtils.isEmpty(resources)) { throw new PrivilegeManagementException("Null Or Empty list of resources"); } validResourcesOrFail(resources); List<ResourceEntity> entities = new ArrayList<>(); appendResourcesInTransaction(resources, zone, entities); }  @Override void appendResources(final List<BaseResource> resources); @Override @Transactional(readOnly = true) List<BaseResource> getResources(); @Override @Transactional(readOnly = true) BaseResource getByResourceIdentifier(final String resourceIdentifier); @Override @Transactional(readOnly = true) BaseResource getByResourceIdentifierWithInheritedAttributes(final String resourceIdentifier); @Override boolean upsertResource(final BaseResource resource); @Override @Transactional boolean deleteResource(final String resourceIdentifier); @Override void appendSubjects(final List<BaseSubject> subjects); @Override @Transactional(readOnly = true) List<BaseSubject> getSubjects(); @Override @Transactional(readOnly = true) BaseSubject getBySubjectIdentifier(final String subjectIdentifier); @Override @Transactional(readOnly = true) BaseSubject getBySubjectIdentifierWithInheritedAttributes(final String subjectIdentifier); @Override @Transactional(readOnly = true) BaseSubject getBySubjectIdentifierAndScopes(final String subjectIdentifier, final Set<Attribute> scopes); @Override boolean upsertSubject(final BaseSubject subject); @Override @Transactional boolean deleteSubject(final String subjectIdentifier); void setCache(final PolicyEvaluationCache cache);  }
@Test public void testAppendResources() { doAppendResourcesAndAssert("/asset/sanramon", "/asset/ny"); }
@Test(expectedExceptions = PrivilegeManagementException.class) public void testAppendNullResources() { this.service.appendResources(null); }
@SuppressWarnings("unchecked") @Test(expectedExceptions = PrivilegeManagementException.class) public void testAppendEmptyResources() { this.service.appendResources(Collections.EMPTY_LIST); }