@Test public void testSaveResourceWithNonexistentParent() { this.dropAllResources(); assertThat(this.graphTraversalSource.V().count().next().intValue(), equalTo(0)); ResourceEntity resource = new ResourceEntity(TEST_ZONE_1, DRIVE_ID); resource.setParents(new HashSet<>(Collections.singletonList(new Parent(BASEMENT_SITE_ID)))); try { this.resourceRepository.save(resource); } catch (IllegalStateException ex) { assertThat(ex.getMessage(), equalTo("No parent exists in zone 'testzone1' with 'resourceId' value of '/site/basement'.")); return; } Assert.fail("save() did not throw the expected IllegalStateException exception."); }
@Override public <S extends ResourceEntity> long count(final Example<S> example) { throw new UnsupportedOperationException(MESSAGE); }
GraphResourceRepository extends GraphGenericRepository<ResourceEntity> implements ResourceRepository, ResourceHierarchicalRepository { @Override public <S extends ResourceEntity> long count(final Example<S> example) { throw new UnsupportedOperationException(MESSAGE); } }
GraphResourceRepository extends GraphGenericRepository<ResourceEntity> implements ResourceRepository, ResourceHierarchicalRepository { @Override public <S extends ResourceEntity> long count(final Example<S> example) { throw new UnsupportedOperationException(MESSAGE); }  }
GraphResourceRepository extends GraphGenericRepository<ResourceEntity> implements ResourceRepository, ResourceHierarchicalRepository { @Override public <S extends ResourceEntity> long count(final Example<S> example) { throw new UnsupportedOperationException(MESSAGE); }  @Override ResourceEntity getByZoneAndResourceIdentifier(final ZoneEntity zone, final String resourceIdentifier); @Override ResourceEntity getResourceWithInheritedAttributes(final ZoneEntity zone, final String resourceIdentifier); @Override Set<String> getResourceEntityAndDescendantsIds(final ResourceEntity 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); }
GraphResourceRepository extends GraphGenericRepository<ResourceEntity> implements ResourceRepository, ResourceHierarchicalRepository { @Override public <S extends ResourceEntity> long count(final Example<S> example) { throw new UnsupportedOperationException(MESSAGE); }  @Override ResourceEntity getByZoneAndResourceIdentifier(final ZoneEntity zone, final String resourceIdentifier); @Override ResourceEntity getResourceWithInheritedAttributes(final ZoneEntity zone, final String resourceIdentifier); @Override Set<String> getResourceEntityAndDescendantsIds(final ResourceEntity 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 RESOURCE_LABEL; static final String RESOURCE_ID_KEY; }