Package | Description |
---|---|
org.assertj.neo4j.api |
Modifier and Type | Method and Description |
---|---|
static RelationshipAssert |
Assertions.assertThat(org.neo4j.graphdb.Relationship relationship) |
RelationshipAssert |
RelationshipAssert.doesNotEndWithNode(org.neo4j.graphdb.Node node) |
RelationshipAssert |
RelationshipAssert.doesNotHaveType(org.neo4j.graphdb.RelationshipType relationshipType)
Verifies that the actual
Relationship does not have the given typeExample: GraphDatabaseService graph = new TestGraphDatabaseFactory().newImpermanentDatabase(); // [...] creation of homerNode, doughnutNode Relationship love = homerNode.createRelationshipTo(doughnutNode, DynamicRelationshipType.withName("LOVES")); assertThat(love).doesNotHaveType(DynamicRelationshipType.withName("HATES")); If the node is null , an IllegalArgumentException is thrown. |
RelationshipAssert |
RelationshipAssert.doesNotHaveType(String relationshipTypeName)
Verifies that the actual
Relationship does not have the given type nameExample: GraphDatabaseService graph = new TestGraphDatabaseFactory().newImpermanentDatabase(); // [...] creation of homerNode, doughnutNode Relationship love = homerNode.createRelationshipTo(doughnutNode, DynamicRelationshipType.withName("LOVES")); assertThat(love).doesNotHaveType("HATES"); If the node is null , an IllegalArgumentException is thrown. |
RelationshipAssert |
RelationshipAssert.doesNotStartWithNode(org.neo4j.graphdb.Node node)
Verifies that the actual
Relationship does not start with the given nodeExample: GraphDatabaseService graph = new TestGraphDatabaseFactory().newImpermanentDatabase(); // [...] creation of homerNode, doughnutNode Relationship love = homerNode.createRelationshipTo(doughnutNode, DynamicRelationshipType.withName("LOVES")); assertThat(love).doesNotStartWithNode(healthyPersonNode); If the node is null , an IllegalArgumentException is thrown. |
RelationshipAssert |
RelationshipAssert.endsWithNode(org.neo4j.graphdb.Node node)
Verifies that the actual
Relationship ends with the given nodeExample: GraphDatabaseService graph = new TestGraphDatabaseFactory().newImpermanentDatabase(); // [...] creation of homerNode, doughnutNode Relationship love = homerNode.createRelationshipTo(doughnutNode, DynamicRelationshipType.withName("LOVES")); assertThat(love).endsWithNode(doughnutNode); If the node is null , an IllegalArgumentException is thrown. |
RelationshipAssert |
RelationshipAssert.hasType(org.neo4j.graphdb.RelationshipType relationshipType)
Verifies that the actual
Relationship has the given typeExample: GraphDatabaseService graph = new TestGraphDatabaseFactory().newImpermanentDatabase(); // [...] creation of homerNode, doughnutNode RelationshipType loveType = DynamicRelationshipType.withName("LOVES"); Relationship love = homerNode.createRelationshipTo(doughnutNode, loveType); assertThat(love).hasType(loveType); If the relationshipType is null , an IllegalArgumentException is thrown. |
RelationshipAssert |
RelationshipAssert.hasType(String relationshipTypeName)
Verifies that the actual
Relationship has the given type nameExample: GraphDatabaseService graph = new TestGraphDatabaseFactory().newImpermanentDatabase(); // [...] creation of homerNode, doughnutNode RelationshipType loveType = DynamicRelationshipType.withName("LOVES"); Relationship love = homerNode.createRelationshipTo(doughnutNode, loveType); assertThat(love).hasType("LOVES"); If the relationshipTypeName is null , an IllegalArgumentException is thrown. |
RelationshipAssert |
RelationshipAssert.startsOrEndsWithNode(org.neo4j.graphdb.Node node)
Verifies that the actual
Relationship either starts or ends with the given nodeExample: GraphDatabaseService graph = new TestGraphDatabaseFactory().newImpermanentDatabase(); // [...] creation of homerNode, doughnutNode Relationship love = homerNode.createRelationshipTo(doughnutNode, DynamicRelationshipType.withName("LOVES")); assertThat(love).startsOrEndsWithNode(homerNode); assertThat(love).startsOrEndsWithNode(doughnutNode); If the node is null , an IllegalArgumentException is thrown. |
RelationshipAssert |
RelationshipAssert.startsWithNode(org.neo4j.graphdb.Node node)
Verifies that the actual
Relationship starts with the given nodeExample: GraphDatabaseService graph = new TestGraphDatabaseFactory().newImpermanentDatabase(); // [...] creation of homerNode, doughnutNode Relationship love = homerNode.createRelationshipTo(doughnutNode, DynamicRelationshipType.withName("LOVES")); assertThat(love).startsWithNode(homerNode); If the node is null , an IllegalArgumentException is thrown. |
Copyright © 2017 AssertJ. All rights reserved.