Skip to content

Commit

Permalink
Fix nondeterministic test failure in DefaultFactoryTest
Browse files Browse the repository at this point in the history
  • Loading branch information
Qi-Cui committed Oct 8, 2024
1 parent cc01c18 commit 23dc48b
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()));
}

/**
Expand Down

0 comments on commit 23dc48b

Please sign in to comment.