use of org.neo4j.ogm.metadata.MetaData in project neo4j-ogm by neo4j.
the class LabelDeterminationTest method metaDataWithImplicitParentPackageShouldWork.
// GH-619
@Test
public void metaDataWithImplicitParentPackageShouldWork() {
MetaData metaData = new MetaData("org.neo4j.ogm.domain.gh619.model");
Collection<String> labels = EntityUtils.labels(new RealNode(), metaData);
assertThat(labels).hasSize(1).containsExactly("real");
}
use of org.neo4j.ogm.metadata.MetaData in project neo4j-ogm by neo4j.
the class LabelDeterminationTest method metaDataFromParentPackageShouldWork.
// GH-619
@Test
public void metaDataFromParentPackageShouldWork() {
MetaData metaData = new MetaData("org.neo4j.ogm.domain.gh619");
Collection<String> labels = EntityUtils.labels(new RealNode(), metaData);
assertThat(labels).hasSize(1).containsExactly("real");
}
use of org.neo4j.ogm.metadata.MetaData in project neo4j-ogm by neo4j.
the class PetIntegrationTest method shouldResolveMetadataCorrectly.
/**
* @see issue #40
*/
@Test
public void shouldResolveMetadataCorrectly() {
MetaData metaData = new MetaData("org.neo4j.ogm.domain.pets");
assertThat(metaData.resolve("Animal").name()).isEqualTo("org.neo4j.ogm.domain.pets.Animal");
assertThat(metaData.resolve("Mammal", "Animal").name()).isEqualTo("org.neo4j.ogm.domain.pets.Mammal");
assertThat(metaData.resolve("Mammal", "Animal", "Dog").name()).isEqualTo("org.neo4j.ogm.domain.pets.Dog");
assertThat(metaData.resolve("Dog", "Mammal", "Animal").name()).isEqualTo("org.neo4j.ogm.domain.pets.Dog");
}
use of org.neo4j.ogm.metadata.MetaData in project neo4j-ogm by neo4j.
the class MovieTest method testDeserialiseMovie.
@Test
public void testDeserialiseMovie() {
MetaData metadata = new MetaData("org.neo4j.ogm.domain.cineasts.annotated");
Neo4jSession session = new Neo4jSession(metadata, true, new MoviesRequest());
Movie movie = session.load(Movie.class, UUID.fromString("38ebe777-bc85-4810-8217-096f29a361f1"), 1);
assertThat(movie.getTitle()).isEqualTo("Pulp Fiction");
assertThat(movie.getRatings()).isNotNull();
assertThat(movie.getRatings()).hasSize(1);
Rating rating = movie.getRatings().iterator().next();
assertThat(rating.getUser().getName()).isEqualTo("Michal");
assertThat(rating.getMovie().getTitle()).isEqualTo("Pulp Fiction");
}
use of org.neo4j.ogm.metadata.MetaData in project neo4j-ogm by neo4j.
the class BookmarkTest method setUp.
@Before
public void setUp() {
BoltDriver driver = new BoltDriver(nativeDriver);
session = new Neo4jSession(new MetaData("org.neo4j.ogm.empty"), true, driver);
}
Aggregations