public class RelationshipAssert extends PropertyContainerAssert<RelationshipAssert,org.neo4j.graphdb.Relationship>
Relationship
Modifier | Constructor and Description |
---|---|
protected |
RelationshipAssert(org.neo4j.graphdb.Relationship actual) |
Modifier and Type | Method and Description |
---|---|
RelationshipAssert |
doesNotEndWithNode(org.neo4j.graphdb.Node node) |
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 |
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 |
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 |
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. |
org.neo4j.graphdb.Relationship |
getActual() |
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 |
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 |
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 |
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. |
doesNotHaveProperty, doesNotHavePropertyKey, hasProperty, hasPropertyKey
as, as, asList, asString, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasToString, inBinary, inHexadecimal, is, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, overridingErrorMessage, satisfies, setCustomRepresentation, throwAssertionError, usingComparator, usingDefaultComparator, withFailMessage, withRepresentation, withThreadDumpOnError
protected RelationshipAssert(org.neo4j.graphdb.Relationship actual)
public org.neo4j.graphdb.Relationship getActual()
getActual
in class PropertyContainerAssert<RelationshipAssert,org.neo4j.graphdb.Relationship>
public RelationshipAssert startsWithNode(org.neo4j.graphdb.Node node)
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.
node
- the expected start node of the actual Relationship
RelationshipAssert
for assertions chainingIllegalArgumentException
- if node
is null
.AssertionError
- if the actual Relationship
does not start with the given nodepublic RelationshipAssert doesNotStartWithNode(org.neo4j.graphdb.Node node)
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.
node
- the expected start node of the actual Relationship
RelationshipAssert
for assertions chainingIllegalArgumentException
- if node
is null
.AssertionError
- if the actual Relationship
starts with the given nodepublic RelationshipAssert endsWithNode(org.neo4j.graphdb.Node node)
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.
node
- the expected end node of the actual Relationship
RelationshipAssert
for assertions chainingIllegalArgumentException
- if node
is null
.AssertionError
- if the actual Relationship
does not end with the given nodepublic RelationshipAssert doesNotEndWithNode(org.neo4j.graphdb.Node node)
public RelationshipAssert startsOrEndsWithNode(org.neo4j.graphdb.Node node)
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.
node
- the expected start or end node of the actual Relationship
RelationshipAssert
for assertions chainingIllegalArgumentException
- if node
is null
.AssertionError
- if the actual Relationship
does not start neither end with the
given nodepublic RelationshipAssert hasType(org.neo4j.graphdb.RelationshipType relationshipType)
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.
relationshipType
- a Relationship
typeRelationshipAssert
for assertions chainingIllegalArgumentException
- if relationshipType
is null
.AssertionError
- if the actual Relationship
does not have the given typepublic RelationshipAssert hasType(String relationshipTypeName)
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.
relationshipTypeName
- a Relationship
type nameRelationshipAssert
for assertions chainingIllegalArgumentException
- if relationshipTypeName
is null
.AssertionError
- if the actual Relationship
does not have the given type namepublic RelationshipAssert doesNotHaveType(org.neo4j.graphdb.RelationshipType relationshipType)
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.
relationshipType
- a Relationship
typeRelationshipAssert
for assertions chainingIllegalArgumentException
- if relationshipType
is null
.AssertionError
- if the actual Relationship
has the given typepublic RelationshipAssert doesNotHaveType(String relationshipTypeName)
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.
relationshipTypeName
- a Relationship
typeRelationshipAssert
for assertions chainingIllegalArgumentException
- if relationshipTypeName
is null
.AssertionError
- if the actual Relationship
has the given typeCopyright © 2017 AssertJ. All rights reserved.