PrivilegeManagementServiceImpl implements PrivilegeManagementService { @Override @Transactional(readOnly = true) public List<BaseSubject> getSubjects() { ZoneEntity zone = this.zoneResolver.getZoneEntityOrFail(); List<BaseSubject> subjects = new ArrayList<>(); List<SubjectEntity> subjectEntities = this.subjectRepository.findByZone(zone); if (!CollectionUtils.isEmpty(subjectEntities)) { for (SubjectEntity subjectEntity : subjectEntities) { subjects.add(this.privilegeConverter.toSubject(subjectEntity)); } } return subjects; }  @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 testGetSubjects() { BaseSubject r1 = createSubject("/asset/macfarland", this.fixedAttributes); BaseSubject r2 = createSubject("/asset/oregon", this.fixedAttributes); this.service.appendSubjects(asList(r1, r2)); List<BaseSubject> subjects = this.service.getSubjects(); Assert.assertEquals(subjects.size(), 2); }