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 /document/src/test/java/com/yahoo/document/json/JsonReaderTestCase.java | |
parent | fbf675fabca097f92d175e65ac4ceedf59ff68c0 (diff) |
Revert "Revert "Reduce the use of hamcrest when normal assertEquals/assertTrue does a…""
Diffstat (limited to 'document/src/test/java/com/yahoo/document/json/JsonReaderTestCase.java')
-rw-r--r-- | document/src/test/java/com/yahoo/document/json/JsonReaderTestCase.java | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/document/src/test/java/com/yahoo/document/json/JsonReaderTestCase.java b/document/src/test/java/com/yahoo/document/json/JsonReaderTestCase.java index c191851acbe..522176d7504 100644 --- a/document/src/test/java/com/yahoo/document/json/JsonReaderTestCase.java +++ b/document/src/test/java/com/yahoo/document/json/JsonReaderTestCase.java @@ -79,13 +79,10 @@ import static com.yahoo.document.json.readers.SingleValueReader.UPDATE_DIVIDE; import static com.yahoo.document.json.readers.SingleValueReader.UPDATE_INCREMENT; import static com.yahoo.document.json.readers.SingleValueReader.UPDATE_MULTIPLY; import static com.yahoo.test.json.JsonTestHelper.inputJson; -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; -import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -797,8 +794,8 @@ public class JsonReaderTestCase { d = r.next(); DocumentUpdate update = (DocumentUpdate) d; checkSimpleArrayAdd(update); - assertThat(update.getCreateIfNonExistent(), is(true)); - assertThat(update.getCondition().getSelection(), is("bla")); + assertTrue(update.getCreateIfNonExistent()); + assertEquals("bla", update.getCondition().getSelection()); d = r.next(); DocumentRemove remove = (DocumentRemove) d; @@ -833,8 +830,8 @@ public class JsonReaderTestCase { for (int x = 0; x < documentsCreated; x++) { DocumentUpdate update = (DocumentUpdate) r.next(); checkSimpleArrayAdd(update); - assertThat(update.getCreateIfNonExistent(), is(true)); - assertThat(update.getCondition().getSelection(), is("bla")); + assertTrue(update.getCreateIfNonExistent()); + assertEquals("bla", update.getCondition().getSelection()); } @@ -1780,7 +1777,7 @@ public class JsonReaderTestCase { @Test public void requireThatUnknownDocTypeThrowsIllegalArgumentException() { exception.expect(IllegalArgumentException.class); - exception.expectMessage(containsString("Document type walrus does not exist")); + exception.expectMessage("Document type walrus does not exist"); final String jsonData = inputJson( "[", @@ -1962,7 +1959,7 @@ public class JsonReaderTestCase { // NOTE: Do not call this method multiple times from a test method as it's using the ExpectedException rule private void assertParserErrorMatches(String expectedError, String... json) { exception.expect(JsonReaderException.class); - exception.expectMessage(containsString(expectedError)); + exception.expectMessage(expectedError); String jsonData = inputJson(json); new JsonReader(types, jsonToInputStream(jsonData), parserFactory).next(); } |