diff options
author | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-09-29 16:40:27 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-09-29 16:40:27 +0200 |
commit | 439089e0db1b0e4f38d2266d649fef2759889469 (patch) | |
tree | aac857b0194fd61ae8ffb5a62b6fbd68b4a8b2f1 /document | |
parent | 7c43a1e913c5c2b6e643812180cfa319743f67fe (diff) |
Revert "Remove unnecessary dependency"
This reverts commit 7c43a1e913c5c2b6e643812180cfa319743f67fe.
Diffstat (limited to 'document')
-rw-r--r-- | document/pom.xml | 5 | ||||
-rw-r--r-- | document/src/test/java/com/yahoo/document/json/JsonTestHelper.java | 13 |
2 files changed, 8 insertions, 10 deletions
diff --git a/document/pom.xml b/document/pom.xml index 9b096f3c89a..529107407ca 100644 --- a/document/pom.xml +++ b/document/pom.xml @@ -48,6 +48,11 @@ <scope>test</scope> </dependency> <dependency> + <groupId>uk.co.datumedge</groupId> + <artifactId>hamcrest-json</artifactId> + <scope>test</scope> + </dependency> + <dependency> <groupId>com.yahoo.vespa</groupId> <artifactId>config</artifactId> <version>${project.version}</version> diff --git a/document/src/test/java/com/yahoo/document/json/JsonTestHelper.java b/document/src/test/java/com/yahoo/document/json/JsonTestHelper.java index f54763dbaea..09e6a74e68a 100644 --- a/document/src/test/java/com/yahoo/document/json/JsonTestHelper.java +++ b/document/src/test/java/com/yahoo/document/json/JsonTestHelper.java @@ -1,10 +1,9 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.document.json; -import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.base.Joiner; -import static org.junit.Assert.assertEquals; -import java.io.IOException; +import static org.hamcrest.MatcherAssert.assertThat; +import static uk.co.datumedge.hamcrest.json.SameJSONAs.sameJSONAs; /** * @author Vegard Sjonfjell @@ -24,13 +23,7 @@ public class JsonTestHelper { * Structurally compare two JSON encoded strings */ public static void assertJsonEquals(String inputJson, String expectedJson) { - try { - ObjectMapper mapper = new ObjectMapper(); - assertEquals(mapper.readTree(inputJson), mapper.readTree(expectedJson)); - } - catch (IOException e) { - throw new RuntimeException(e); - } + assertThat(inputJson, sameJSONAs(expectedJson)); } } |