diff --git a/gora-mongodb/src/test/java/org/apache/gora/mongodb/filters/DefaultFactoryTest.java b/gora-mongodb/src/test/java/org/apache/gora/mongodb/filters/DefaultFactoryTest.java index 10258ba72..da58e6639 100644 --- a/gora-mongodb/src/test/java/org/apache/gora/mongodb/filters/DefaultFactoryTest.java +++ b/gora-mongodb/src/test/java/org/apache/gora/mongodb/filters/DefaultFactoryTest.java @@ -18,6 +18,7 @@ package org.apache.gora.mongodb.filters; import com.mongodb.MongoClientSettings; +import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.avro.util.Utf8; import org.apache.gora.examples.generated.WebPage; import org.apache.gora.filter.FilterList; @@ -116,8 +117,12 @@ public void testCreateFilter_list_2() throws Exception { filter.addFilter(urlFilter); Bson dbObject = filterFactory.createFilter(filter, store); - assertEquals(new JSONObject("{ \"h.C·T\" : \"text/html\" , \"url\" : \"http://www.example.com\"}").toString(), - new JSONObject(asJson(dbObject)).toString()); + JSONObject expectedJSON = new JSONObject("{ \"h.C·T\" : \"text/html\" , \"url\" : \"http://www.example.com\"}"); + JSONObject actualJSON = new JSONObject(asJson(dbObject)); + + ObjectMapper mapper = new ObjectMapper(); + + assertEquals(mapper.readTree(expectedJSON.toString()), mapper.readTree(actualJSON.toString())); } /**