Database Reference
In-Depth Information
while(objResult.hasNext()){
Node cypherNode = (Node)objResult.next();
//Check that Label matches with the same Label what
was created initially
Assert.assertTrue(cypherNode.hasLabel(DynamicLabel.label(testLabel)));
}
Further, we iterate through the results of the Cypher query and check whether the
label of both the nodes is the same.
6. Now, let's run our JUnits once again and execute $M2_HOME/bin/mvn test
from the root of your Java project, that is, MyNeo4jSamples , and this time you
should see a successful build.
Easy and simpleā€¦isn't it?
Yes it is, but the only drawback is that there is a lot of boilerplate code such as iterating
through the Cypher result set, which needs to be written for each and every JUnit.
Although we can create some helper methods, they also need to check everything such as
nodes, labels, properties, paths, and many more conditions, which would be a time-con-
suming task.
Search WWH ::




Custom Search