From 97f246b4ba3f77f87751a374c587a2c84d3406ab Mon Sep 17 00:00:00 2001 From: Tommaso Teofili Date: Fri, 29 Sep 2017 15:34:43 +0200 Subject: [PATCH] LUCENE-7981 - CTB should check that CR is not null --- .../org/apache/lucene/classification/ClassificationTestBase.java | 1 + 1 file changed, 1 insertion(+) diff --git a/lucene/classification/src/test/org/apache/lucene/classification/ClassificationTestBase.java b/lucene/classification/src/test/org/apache/lucene/classification/ClassificationTestBase.java index 6c8f7fde833..b3220b068c4 100644 --- a/lucene/classification/src/test/org/apache/lucene/classification/ClassificationTestBase.java +++ b/lucene/classification/src/test/org/apache/lucene/classification/ClassificationTestBase.java @@ -88,6 +88,7 @@ public abstract class ClassificationTestBase extends LuceneTestCase { protected ClassificationResult checkCorrectClassification(Classifier classifier, String inputDoc, T expectedResult) throws Exception { ClassificationResult classificationResult = classifier.assignClass(inputDoc); + assertNotNull(classificationResult); T assignedClass = classificationResult.getAssignedClass(); assertNotNull(assignedClass); assertEquals("got an assigned class of " + assignedClass, expectedResult instanceof BytesRef ? ((BytesRef) expectedResult).utf8ToString() : expectedResult, assignedClass instanceof BytesRef ? ((BytesRef) assignedClass).utf8ToString() : assignedClass);