Skip to content

Commit 145c282

Browse files
committed
refactor ConnectiveJanusPredicate test to improve clarity and assertions
1 parent 30f554d commit 145c282

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

janusgraph-test/src/test/java/org/janusgraph/graphdb/predicate/ConnectiveJanusPredicateTest.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,17 @@ public void testTestDifferentSize() {
104104
@Test
105105
public void testTest() {
106106
final ConnectiveJanusPredicate predicate = getPredicate(Arrays.asList(Text.PREFIX, Cmp.EQUAL));
107-
assertTrue(predicate.test("john",Arrays.asList("jo", "john")));
108-
assertEquals(predicate.isOr(), predicate.test("john",Arrays.asList("jo", "mike")));
109-
assertEquals(predicate.isOr(), predicate.test("john",Arrays.asList("mi", "john")));
110-
assertFalse(predicate.test("john",Arrays.asList("mi", "mike")));
107+
108+
assertTrue(predicate.test("john", Arrays.asList("jo", "john")),
109+
"Expected true: 'john' matches with one of ['jo', 'john'] using PREFIX EQUAL");
110+
111+
assertEquals(true, predicate.isOr(),
112+
"Expected isOr() to be true after testing 'john' with ['jo', 'mike']");
113+
114+
assertEquals(predicate.isOr(), predicate.test("john", Arrays.asList("mi", "john")),
115+
"Expected the same isOr result when testing 'john' with ['mi', 'john']");
116+
117+
assertFalse(predicate.test("john", Arrays.asList("mi", "mike")),
118+
"'john' should not match any of ['mi', 'mike'] using PREFIX EQUAL");
111119
}
112120
}

0 commit comments

Comments
 (0)