From b3550161d877ee269e31efb2edd06946c2af1b00 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Thu, 28 Mar 2024 14:19:51 +0100 Subject: [PATCH] Sort order for JSON files --- .../org/opentripplanner/test/support/JsonAssertions.java | 6 +++--- .../org/opentripplanner/apis/vectortiles/style.json | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/opentripplanner/test/support/JsonAssertions.java b/src/test/java/org/opentripplanner/test/support/JsonAssertions.java index f57e5a6741d..33d3f790db8 100644 --- a/src/test/java/org/opentripplanner/test/support/JsonAssertions.java +++ b/src/test/java/org/opentripplanner/test/support/JsonAssertions.java @@ -5,7 +5,6 @@ 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 { @@ -13,7 +12,7 @@ public class JsonAssertions { private static final ObjectMapper MAPPER = new ObjectMapper(); static { - MAPPER.configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true); + //MAPPER.configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true); } /** @@ -32,8 +31,9 @@ public static void assertEqualJson(String expected, String actual) { */ public static void assertEqualJson(String expected, JsonNode actual) { try { + var actualNode = MAPPER.readTree(actual.toString()); var exp = MAPPER.readTree(expected); - assertEquals(JsonSupport.prettyPrint(exp), JsonSupport.prettyPrint(actual)); + assertEquals(exp, actualNode, () -> "Expected '%s' but actual was '%s'".formatted(JsonSupport.prettyPrint(exp), JsonSupport.prettyPrint(actualNode))); } catch (JsonProcessingException e) { throw new RuntimeException(e); } diff --git a/src/test/resources/org/opentripplanner/apis/vectortiles/style.json b/src/test/resources/org/opentripplanner/apis/vectortiles/style.json index f8a6a80e44c..3f3aef9ab23 100644 --- a/src/test/resources/org/opentripplanner/apis/vectortiles/style.json +++ b/src/test/resources/org/opentripplanner/apis/vectortiles/style.json @@ -244,6 +244,6 @@ } } ], - "version" : 8, - "glyphs" : "https://cdn.jsdelivr.net/gh/klokantech/klokantech-gl-fonts@master/{fontstack}/{range}.pbf" + "glyphs" : "https://cdn.jsdelivr.net/gh/klokantech/klokantech-gl-fonts@master/{fontstack}/{range}.pbfi", + "version" : 8 } \ No newline at end of file