GraphSubjectRepository extends GraphGenericRepository<SubjectEntity> implements SubjectRepository, SubjectHierarchicalRepository { @Override public SubjectEntity getByZoneAndSubjectIdentifier(final ZoneEntity zone, final String subjectIdentifier) { return getEntity(zone, subjectIdentifier); }  @Override SubjectEntity getByZoneAndSubjectIdentifier(final ZoneEntity zone, final String subjectIdentifier); @Override SubjectEntity getSubjectWithInheritedAttributes(final ZoneEntity zone, final String subjectIdentifier); @Override SubjectEntity getSubjectWithInheritedAttributesForScopes(final ZoneEntity zone,
            final String subjectIdentifier, final Set<Attribute> scopes); @Override Set<String> getSubjectEntityAndDescendantsIds(final SubjectEntity entity); @Override List<S> findAll(final Example<S> example); @Override List<S> findAll(final Example<S> example, final Sort sort); @Override S findOne(final Example<S> example); @Override Page<S> findAll(final Example<S> example, final Pageable pageable); @Override long count(final Example<S> example); @Override boolean exists(final Example<S> example); static final String SUBJECT_LABEL; static final String SUBJECT_ID_KEY; }
@Test(threadPoolSize = CONCURRENT_TEST_THREAD_COUNT, invocationCount = CONCURRENT_TEST_INVOCATIONS) public void testGetByZoneAndSubjectIdentifier() { SubjectEntity subjectEntityForZone1 = persistRandomSubjectToZone1AndAssert(); SubjectEntity subjectEntityForZone2 = persistRandomSubjectToZone2AndAssert(); SubjectEntity actualSubjectForZone1 = this.subjectRepository .getByZoneAndSubjectIdentifier(TEST_ZONE_1, subjectEntityForZone1.getSubjectIdentifier()); SubjectEntity actualSubjectForZone2 = this.subjectRepository .getByZoneAndSubjectIdentifier(TEST_ZONE_2, subjectEntityForZone2.getSubjectIdentifier()); assertThat(actualSubjectForZone1, equalTo(subjectEntityForZone1)); assertThat(actualSubjectForZone2, equalTo(subjectEntityForZone2)); this.subjectRepository.delete(subjectEntityForZone1); this.subjectRepository.delete(subjectEntityForZone2); }
@Test(threadPoolSize = CONCURRENT_TEST_THREAD_COUNT, invocationCount = CONCURRENT_TEST_INVOCATIONS) public void testSaveWithNoAttributes() { SubjectEntity subject = new SubjectEntity(TEST_ZONE_1, AGENT_SCULLY + getRandomNumber()); saveWithRetry(subject, 3); assertThat(this.subjectRepository.getByZoneAndSubjectIdentifier(TEST_ZONE_1, subject.getSubjectIdentifier()), equalTo(subject)); this.subjectRepository.delete(subject); }