From 2a1771b84a3b3a2d3d0cb5312da78bd2d7d9bd07 Mon Sep 17 00:00:00 2001 From: Tom Cunningham Date: Fri, 21 Mar 2025 14:07:12 -0400 Subject: [PATCH] Use JSONAssert rather than assertEquals for better failure output / order insensitivity --- components-starter/camel-openapi-java-starter/pom.xml | 6 ++++++ .../java/org/apache/camel/openapi/ComplexTypesTest.java | 4 +++- tooling/camel-spring-boot-dependencies/pom.xml | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/components-starter/camel-openapi-java-starter/pom.xml b/components-starter/camel-openapi-java-starter/pom.xml index 3056b6916c14..5aee63e9b7c7 100644 --- a/components-starter/camel-openapi-java-starter/pom.xml +++ b/components-starter/camel-openapi-java-starter/pom.xml @@ -83,6 +83,12 @@ spring-test test + + org.skyscreamer + jsonassert + ${jsonassert-version} + test + org.apache.camel.springboot diff --git a/components-starter/camel-openapi-java-starter/src/test/java/org/apache/camel/openapi/ComplexTypesTest.java b/components-starter/camel-openapi-java-starter/src/test/java/org/apache/camel/openapi/ComplexTypesTest.java index eefaa9513275..f6ca5c5f2707 100644 --- a/components-starter/camel-openapi-java-starter/src/test/java/org/apache/camel/openapi/ComplexTypesTest.java +++ b/components-starter/camel-openapi-java-starter/src/test/java/org/apache/camel/openapi/ComplexTypesTest.java @@ -33,6 +33,8 @@ import org.junit.jupiter.api.Test; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -134,7 +136,7 @@ private void checkSchemaGeneration(String uri, String apiVersion, String schemaR .collect(Collectors.joining("\n")); is.close(); - assertEquals(expected, json); + JSONAssert.assertEquals(expected, json, JSONCompareMode.STRICT); } private BeanConfig getBeanConfig(String apiVersion) { diff --git a/tooling/camel-spring-boot-dependencies/pom.xml b/tooling/camel-spring-boot-dependencies/pom.xml index 9a7b3bcf24bf..6252431a9fe4 100644 --- a/tooling/camel-spring-boot-dependencies/pom.xml +++ b/tooling/camel-spring-boot-dependencies/pom.xml @@ -4457,7 +4457,7 @@ org.apache.maven.plugin-tools maven-plugin-annotations - 3.13.1 + 3.15.1 org.apache.maven.plugins