Search in sources :

Example 1 with Thing

use of org.neo4j.ogm.domain.gh552.Thing in project neo4j-ogm by neo4j.

the class SingleUseEntityMapperTest method shouldLookupCorrectRootClass.

// GH-552
@Test
public void shouldLookupCorrectRootClass() {
    MetaData metaData = new MetaData("org.neo4j.ogm.domain.gh552");
    String propertyKey = "notAName";
    Map<String, Object> properties = Collections.singletonMap(propertyKey, "NOT A NAME!!!");
    SingleUseEntityMapper entityMapper = new SingleUseEntityMapper(metaData, new ReflectionEntityInstantiator(metaData));
    Thing thing = entityMapper.map(Thing.class, properties);
    assertThat(thing.getNotAName()).isEqualTo(properties.get(propertyKey));
}
Also used : MetaData(org.neo4j.ogm.metadata.MetaData) ReflectionEntityInstantiator(org.neo4j.ogm.metadata.reflect.ReflectionEntityInstantiator) AnotherThing(org.neo4j.ogm.domain.gh551.AnotherThing) Thing(org.neo4j.ogm.domain.gh552.Thing) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 AnotherThing (org.neo4j.ogm.domain.gh551.AnotherThing)1 Thing (org.neo4j.ogm.domain.gh552.Thing)1 MetaData (org.neo4j.ogm.metadata.MetaData)1 ReflectionEntityInstantiator (org.neo4j.ogm.metadata.reflect.ReflectionEntityInstantiator)1