diff options
Diffstat (limited to 'testutil/src')
-rw-r--r-- | testutil/src/main/java/com/yahoo/test/json/JsonTestHelper.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/testutil/src/main/java/com/yahoo/test/json/JsonTestHelper.java b/testutil/src/main/java/com/yahoo/test/json/JsonTestHelper.java index 08afb2fd95f..05532d2a504 100644 --- a/testutil/src/main/java/com/yahoo/test/json/JsonTestHelper.java +++ b/testutil/src/main/java/com/yahoo/test/json/JsonTestHelper.java @@ -5,11 +5,10 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.base.Joiner; -import org.hamcrest.MatcherAssert; import java.io.UncheckedIOException; -import static uk.co.datumedge.hamcrest.json.SameJSONAs.sameJSONAs; +import static org.junit.Assert.assertEquals; /** * @author Vegard Sjonfjell @@ -29,7 +28,13 @@ public class JsonTestHelper { /** Structurally compare two JSON encoded strings */ public static void assertJsonEquals(String inputJson, String expectedJson) { - MatcherAssert.assertThat(inputJson, sameJSONAs(expectedJson)); + try { + JsonNode expected = mapper.readTree(expectedJson); + JsonNode actual = mapper.readTree(inputJson); + assertEquals(expected, actual); + } catch (JsonProcessingException e) { + throw new RuntimeException("Exception when comparing json strings." , e); + } } /** Structurally compare a {@link JsonNode} and a JSON string. */ |