public class NodeAssert extends PropertyContainerAssert<NodeAssert,org.neo4j.graphdb.Node>
Node| Modifier | Constructor and Description |
|---|---|
protected |
NodeAssert(org.neo4j.graphdb.Node actual) |
| Modifier and Type | Method and Description |
|---|---|
NodeAssert |
doesNotHaveLabel(org.neo4j.graphdb.Label label)
Verifies that the actual
Node does NOT have the given label |
NodeAssert |
doesNotHaveLabel(String labelValue)
Verifies that the actual
Node does NOT have the given label name |
org.neo4j.graphdb.Node |
getActual() |
NodeAssert |
hasLabel(org.neo4j.graphdb.Label label)
Verifies that the actual
Node has the given label |
NodeAssert |
hasLabel(String labelValue)
Verifies that the actual
Node has the given label name |
doesNotHaveProperty, doesNotHavePropertyKey, hasProperty, hasPropertyKeyas, 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, withThreadDumpOnErrorpublic org.neo4j.graphdb.Node getActual()
getActual in class PropertyContainerAssert<NodeAssert,org.neo4j.graphdb.Node>public NodeAssert hasLabel(String labelValue)
Node has the given label nameExample:
GraphDatabaseService graph = new TestGraphDatabaseFactory().newImpermanentDatabase();
Node node = graph.createNode();
node.addLabel(DynamicLabel.label("DOUGHNUT_LOVER"));
assertThat(node).hasLabel("DOUGHNUT_LOVER");
If the labelValue is null, an IllegalArgumentException is thrown.
labelValue - the label name to look for in the actual NodeNodeAssert for assertions chainingIllegalArgumentException - if labelValue is null.AssertionError - if the actual Node does not contain the given labelpublic NodeAssert doesNotHaveLabel(String labelValue)
Node does NOT have the given label nameExample:
GraphDatabaseService graph = new TestGraphDatabaseFactory().newImpermanentDatabase();
Node node = graph.createNode();
node.addLabel(DynamicLabel.label("DOUGHNUT_LOVER"));
assertThat(node).doesNotHaveLabel("FRUIT_LOVER");
If the labelValue is null, an IllegalArgumentException is thrown.
labelValue - the label name to look for in the actual NodeNodeAssert for assertions chainingIllegalArgumentException - if labelValue is null.AssertionError - if the actual Node does contain the given labelpublic NodeAssert hasLabel(org.neo4j.graphdb.Label label)
Node has the given labelExample:
GraphDatabaseService graph = new TestGraphDatabaseFactory().newImpermanentDatabase();
Node node = graph.createNode();
Label doughnutLover = DynamicLabel.label("DOUGHNUT_LOVER");
node.addLabel(doughnutLover);
assertThat(node).hasLabel(doughnutLover);
If the label is null, an IllegalArgumentException is thrown.
label - the label to look for in the actual NodeNodeAssert for assertions chainingIllegalArgumentException - if label is null.AssertionError - if the actual Node does not contain the given labelpublic NodeAssert doesNotHaveLabel(org.neo4j.graphdb.Label label)
Node does NOT have the given labelExample:
GraphDatabaseService graph = new TestGraphDatabaseFactory().newImpermanentDatabase();
Node node = graph.createNode();
node.addLabel(DynamicLabel.label("DOUGHNUT_LOVER"));
assertThat(node).doesNotHaveLabel(DynamicLabel.label("FRUIT_LOVER"));
If the label is null, an IllegalArgumentException is thrown.
label - the label to look for in the actual NodeNodeAssert for assertions chainingIllegalArgumentException - if label is null.AssertionError - if the actual Node does contain the given labelCopyright © 2017 AssertJ. All rights reserved.