Search in sources :

Example 11 with Satellite

use of org.neo4j.ogm.domain.satellites.Satellite 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();
}
Also used : Program(org.neo4j.ogm.domain.satellites.Program) Satellite(org.neo4j.ogm.domain.satellites.Satellite) FieldInfo(org.neo4j.ogm.metadata.FieldInfo) ClassInfo(org.neo4j.ogm.metadata.ClassInfo) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)11 Satellite (org.neo4j.ogm.domain.satellites.Satellite)11 ClassInfo (org.neo4j.ogm.metadata.ClassInfo)4 FieldInfo (org.neo4j.ogm.metadata.FieldInfo)4 Transaction (org.neo4j.ogm.transaction.Transaction)4 ArrayList (java.util.ArrayList)2 SortOrder (org.neo4j.ogm.cypher.query.SortOrder)2 Date (java.util.Date)1 HashMap (java.util.HashMap)1 Filter (org.neo4j.ogm.cypher.Filter)1 Member (org.neo4j.ogm.domain.forum.Member)1 Topic (org.neo4j.ogm.domain.forum.Topic)1 Comment (org.neo4j.ogm.domain.forum.activity.Comment)1 Post (org.neo4j.ogm.domain.forum.activity.Post)1 Program (org.neo4j.ogm.domain.satellites.Program)1