use of org.neo4j.ogm.domain.satellites.Program in project neo4j-ogm by neo4j.
the class SatelliteIntegrationTest method shouldReturnProgramsSortedByRefDesc.
@Test
public void shouldReturnProgramsSortedByRefDesc() {
Collection<Program> objects = session.loadAll(Program.class, new SortOrder().add(SortOrder.Direction.DESC, "ref"));
Iterator<Program> iter = objects.iterator();
Program first = iter.next();
while (iter.hasNext()) {
Program next = iter.next();
assertThat(first.getRef().compareTo(next.getRef()) > 0).isTrue();
first = next;
}
}
use of org.neo4j.ogm.domain.satellites.Program in project neo4j-ogm by neo4j.
the class EntityAccessManagerTest method shouldRetrieveObjectAccessForWritingIterableObject.
@Test
public void shouldRetrieveObjectAccessForWritingIterableObject() {
ClassInfo classInfo = this.domainInfo.getClass(Program.class.getName());
FieldInfo iterableAccess = EntityAccessManager.getIterableField(classInfo, Satellite.class, "satellites", Relationship.Direction.OUTGOING);
assertThat(iterableAccess).as("The resultant object accessor shouldn't be null").isNotNull();
Program spaceProgramme = new Program();
iterableAccess.write(spaceProgramme, Arrays.asList(new Satellite()));
assertThat(spaceProgramme.getSatellites()).as("The satellites list wasn't set correctly").isNotNull();
assertThat(spaceProgramme.getSatellites().isEmpty()).as("The satellites list wasn't set correctly").isFalse();
}