PrivilegeManagementServiceImpl implements PrivilegeManagementService { @Override public boolean upsertResource(final BaseResource resource) { ZoneEntity zone = this.zoneResolver.getZoneEntityOrFail(); validateResourceOrFail(resource); ResourceEntity updatedResource = this.privilegeConverter.toResourceEntity(zone, resource); ResourceEntity persistedResource = upsertResourceInTransaction(resource, zone, updatedResource); return persistedResource == null; }  @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(expectedExceptions = PrivilegeManagementException.class) public void testCreateNullResources() { this.service.upsertResource(null); }