Use correct contains method
@@ -60,7 +60,6 @@ import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
-import org.mockito.ArgumentMatchers;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -80,6 +79,7 @@ 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;
@@ -1733,7 +1733,7 @@ public class JsonReaderTestCase {
@Test
public void requireThatUnknownDocTypeThrowsIllegalArgumentException() {
exception.expect(IllegalArgumentException.class);
- exception.expectMessage(ArgumentMatchers.contains("Document type walrus does not exist"));
+ exception.expectMessage(containsString("Document type walrus does not exist"));
final String jsonData = inputJson(
"[",
@@ -1903,7 +1903,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(ArgumentMatchers.contains(expectedError));
+ exception.expectMessage(containsString(expectedError));
String jsonData = inputJson(json);
new JsonReader(types, jsonToInputStream(jsonData), parserFactory).next();
}
