aboutsummaryrefslogtreecommitdiffstats
path: root/predicate-search-core/src/test/java/com/yahoo/document/predicate/RangeEdgePartitionTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'predicate-search-core/src/test/java/com/yahoo/document/predicate/RangeEdgePartitionTest.java')
-rw-r--r--predicate-search-core/src/test/java/com/yahoo/document/predicate/RangeEdgePartitionTest.java33
1 files changed, 16 insertions, 17 deletions
diff --git a/predicate-search-core/src/test/java/com/yahoo/document/predicate/RangeEdgePartitionTest.java b/predicate-search-core/src/test/java/com/yahoo/document/predicate/RangeEdgePartitionTest.java
index be01b1cd842..00a25e4dc49 100644
--- a/predicate-search-core/src/test/java/com/yahoo/document/predicate/RangeEdgePartitionTest.java
+++ b/predicate-search-core/src/test/java/com/yahoo/document/predicate/RangeEdgePartitionTest.java
@@ -1,10 +1,9 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.document.predicate;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-import static org.junit.Assert.*;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.*;
/**
* @author <a href="mailto:magnarn@yahoo-inc.com">Magnar Nedland</a>
@@ -12,12 +11,12 @@ import static org.junit.Assert.assertEquals;
public class RangeEdgePartitionTest {
@Test
- public void requireThatRangeEdgePartitionIsAValue() {
+ void requireThatRangeEdgePartitionIsAValue() {
assertTrue(PredicateValue.class.isAssignableFrom(RangeEdgePartition.class));
}
@Test
- public void requireThatConstructorsWork() {
+ void requireThatConstructorsWork() {
RangeEdgePartition part = new RangeEdgePartition("foo=10", 10, 0, -1);
assertEquals("foo=10", part.getLabel());
assertEquals(0, part.getLowerBound());
@@ -25,7 +24,7 @@ public class RangeEdgePartitionTest {
}
@Test
- public void requireThatCloneIsImplemented() throws CloneNotSupportedException {
+ void requireThatCloneIsImplemented() throws CloneNotSupportedException {
RangeEdgePartition node1 = new RangeEdgePartition("foo=10", 10, 0, 0);
RangeEdgePartition node2 = node1.clone();
assertEquals(node1, node2);
@@ -33,29 +32,29 @@ public class RangeEdgePartitionTest {
}
@Test
- public void requireThatHashCodeIsImplemented() {
+ void requireThatHashCodeIsImplemented() {
assertEquals(new RangeEdgePartition("foo=-10", 10, 2, 3).hashCode(),
new RangeEdgePartition("foo=-10", 10, 2, 3).hashCode());
}
@Test
- public void requireThatEqualsIsImplemented() {
+ void requireThatEqualsIsImplemented() {
RangeEdgePartition lhs = new RangeEdgePartition("foo=10", 10, 5, 10);
- assertTrue(lhs.equals(lhs));
- assertFalse(lhs.equals(new Object()));
+ assertEquals(lhs, lhs);
+ assertNotEquals(lhs, new Object());
RangeEdgePartition rhs = new RangeEdgePartition("foo=20", 20, 0, 0);
- assertFalse(lhs.equals(rhs));
+ assertNotEquals(lhs, rhs);
rhs = new RangeEdgePartition("foo=10", 10, 5, 10);
- assertTrue(lhs.equals(rhs));
- assertFalse(lhs.equals(new RangeEdgePartition("foo=10", 10, 5, 11)));
- assertFalse(lhs.equals(new RangeEdgePartition("foo=10", 10, 6, 10)));
- assertFalse(lhs.equals(new RangeEdgePartition("foo=10", 11, 5, 10)));
- assertFalse(lhs.equals(new RangeEdgePartition("foo=11", 10, 5, 10)));
+ assertEquals(lhs, rhs);
+ assertNotEquals(lhs, new RangeEdgePartition("foo=10", 10, 5, 11));
+ assertNotEquals(lhs, new RangeEdgePartition("foo=10", 10, 6, 10));
+ assertNotEquals(lhs, new RangeEdgePartition("foo=10", 11, 5, 10));
+ assertNotEquals(lhs, new RangeEdgePartition("foo=11", 10, 5, 10));
}
@Test
- public void requireThatKeyIsEscapedInToString() {
+ void requireThatKeyIsEscapedInToString() {
assertEquals("foo=10+[2..3]", new RangeEdgePartition("foo=10", 10, 2, 3).toString());
assertEquals("'\\foo=10'+[2..3]", new RangeEdgePartition("\foo=10", 10, 2, 3).toString());
assertEquals("'\\x27foo\\x27=10'+[2..3]", new RangeEdgePartition("'foo'=10", 10, 2, 3).toString());