use of org.neo4j.ogm.domain.gh750.ThingResult3 in project neo4j-ogm by neo4j.
the class SingleUseEntityMapperTest method shouldWorkWithCustomConvertersOnListProperty.
// GH-750
@Test
public void shouldWorkWithCustomConvertersOnListProperty() {
SingleUseEntityMapper entityMapper = new SingleUseEntityMapper(sessionFactory.metaData(), new ReflectionEntityInstantiator(sessionFactory.metaData()));
Iterable<Map<String, Object>> results = sessionFactory.openSession().query("RETURN ['foo', 'bar'] AS foobars", EMPTY_MAP).queryResults();
assertThat(results).hasSize(1);
ThingResult3 thingResult = entityMapper.map(ThingResult3.class, results.iterator().next());
assertThat(thingResult.getFoobars()).extracting(ThingResult3.FooBar::getValue).containsExactlyInAnyOrder("foo", "bar");
}
use of org.neo4j.ogm.domain.gh750.ThingResult3 in project neo4j-ogm by neo4j.
the class SingleUseEntityMapperTest method shouldWorkWithCustomConverters.
// GH-750
@Test
public void shouldWorkWithCustomConverters() {
SingleUseEntityMapper entityMapper = new SingleUseEntityMapper(sessionFactory.metaData(), new ReflectionEntityInstantiator(sessionFactory.metaData()));
Iterable<Map<String, Object>> results = sessionFactory.openSession().query("RETURN 'foo' AS foobar", EMPTY_MAP).queryResults();
assertThat(results).hasSize(1);
ThingResult3 thingResult = entityMapper.map(ThingResult3.class, results.iterator().next());
assertThat(thingResult.getFoobar()).isNotNull();
assertThat(thingResult.getFoobar().getValue()).isEqualTo("foo");
}
Aggregations