diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-08-12 09:02:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-12 09:02:42 +0200 |
commit | 2ce190a1fe3e30a366c20ceb611d0f838842f82d (patch) | |
tree | 7f6fa87d653b183821126df3e5ef4ded313b4db5 /docproc/src/test/java/com/yahoo/docproc/ProcessingTestCase.java | |
parent | fbf675fabca097f92d175e65ac4ceedf59ff68c0 (diff) |
Revert "Revert "Reduce the use of hamcrest when normal assertEquals/assertTrue does a…""
Diffstat (limited to 'docproc/src/test/java/com/yahoo/docproc/ProcessingTestCase.java')
-rw-r--r-- | docproc/src/test/java/com/yahoo/docproc/ProcessingTestCase.java | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/docproc/src/test/java/com/yahoo/docproc/ProcessingTestCase.java b/docproc/src/test/java/com/yahoo/docproc/ProcessingTestCase.java index 8d3e387a0c5..e72b9d991b6 100644 --- a/docproc/src/test/java/com/yahoo/docproc/ProcessingTestCase.java +++ b/docproc/src/test/java/com/yahoo/docproc/ProcessingTestCase.java @@ -7,8 +7,10 @@ import org.junit.Test; import java.util.Iterator; import java.util.Map; -import static org.hamcrest.CoreMatchers.*; -import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; /** * @author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a> @@ -18,8 +20,8 @@ public class ProcessingTestCase { @Test public void serviceName() { - assertThat(new Processing().getServiceName(), is("default")); - assertThat(new Processing("foobar", (DocumentOperation) null, null).getServiceName(), is("foobar")); + assertEquals("default", new Processing().getServiceName()); + assertEquals("foobar", new Processing("foobar", (DocumentOperation) null, null).getServiceName()); } @Test @@ -30,21 +32,21 @@ public class ProcessingTestCase { p.setVariable("bar", "apple"); Iterator<Map.Entry<String, Object>> it = p.getVariableAndNameIterator(); - assertThat(it.hasNext(), is(true)); - assertThat(it.next(), not(nullValue())); - assertThat(it.hasNext(), is(true)); - assertThat(it.next(), not(nullValue())); - assertThat(it.hasNext(), is(false)); + assertTrue(it.hasNext()); + assertNotNull(it.next()); + assertTrue(it.hasNext()); + assertNotNull(it.next()); + assertFalse(it.hasNext()); - assertThat(p.hasVariable("foo"), is(true)); - assertThat(p.hasVariable("bar"), is(true)); - assertThat(p.hasVariable("baz"), is(false)); + assertTrue(p.hasVariable("foo")); + assertTrue(p.hasVariable("bar")); + assertFalse(p.hasVariable("baz")); - assertThat(p.removeVariable("foo"), is("banana")); + assertEquals("banana", p.removeVariable("foo")); p.clearVariables(); it = p.getVariableAndNameIterator(); - assertThat(it.hasNext(), is(false)); + assertFalse(it.hasNext()); } } |