A test throws a NPE instead of an assertion failure :
java.lang.NullPointerException
at uk.org.webcompere.modelassert.json.condition.PredicateWrappedCondition.test(PredicateWrappedCondition.java:50)
at uk.org.webcompere.modelassert.json.condition.tree.TreeComparisonCondition.lambda$isKeyAllowedByRules$1(TreeComparisonCondition.java:174)
at java.util.Optional.map(Optional.java:215)
at uk.org.webcompere.modelassert.json.condition.tree.TreeComparisonCondition.isKeyAllowedByRules(TreeComparisonCondition.java:174)
at uk.org.webcompere.modelassert.json.condition.tree.TreeComparisonCondition.lambda$reportKeys$0(TreeComparisonCondition.java:164)
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174)
at java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1580)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566)
at uk.org.webcompere.modelassert.json.condition.tree.TreeComparisonCondition.reportKeys(TreeComparisonCondition.java:165)
at uk.org.webcompere.modelassert.json.condition.tree.TreeComparisonCondition.compareObjects(TreeComparisonCondition.java:138)
at uk.org.webcompere.modelassert.json.condition.tree.TreeComparisonCondition.compareTrees(TreeComparisonCondition.java:115)
at uk.org.webcompere.modelassert.json.condition.tree.TreeComparisonCondition.test(TreeComparisonCondition.java:74)
at uk.org.webcompere.modelassert.json.assertjson.AssertJson.satisfies(AssertJson.java:31)
at uk.org.webcompere.modelassert.json.assertjson.AssertJson.satisfies(AssertJson.java:14)
at uk.org.webcompere.modelassert.json.dsl.nodespecific.tree.WhereDsl.isEqualTo(WhereDsl.java:110)
at uk.org.webcompere.modelassert.json.dsl.nodespecific.tree.IsEqualToDsl.isEqualTo(IsEqualToDsl.java:39)
at ogosecurity.rest.api.ModelAssertTest.npe(ModelAssertTest.java:16)
at java.lang.reflect.Method.invoke(Method.java:498)
at java.util.concurrent.RecursiveAction.exec(RecursiveAction.java:189)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175)
Summary
A test throws a NPE instead of an assertion failure :
Expected green or red test
This test should fail gracefully :