Skip to content

Commit

Permalink
Sort by keys before comparing
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Mar 28, 2024
1 parent 6881207 commit 6afb865
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import org.opentripplanner.standalone.config.framework.json.JsonSupport;

public class JsonAssertions {

private static final ObjectMapper MAPPER = new ObjectMapper();

static {
MAPPER.configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true);
}

/**
* Take two JSON documents and reformat them before comparing {@code actual} with {@code expected}.
*/
Expand Down

0 comments on commit 6afb865

Please sign in to comment.