From 9983b1f11132f4b89ca58fea41a14604fc442b1c Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Mon, 17 Jul 2023 16:18:38 +0200 Subject: [PATCH] Make report format tests more reliable This commit ensures that report format tests don't break when the ordering of reported missing fields change. --- .../graphql/execution/SchemaMappingInspectorTests.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-graphql/src/test/java/org/springframework/graphql/execution/SchemaMappingInspectorTests.java b/spring-graphql/src/test/java/org/springframework/graphql/execution/SchemaMappingInspectorTests.java index f2982c09..cc959b81 100644 --- a/spring-graphql/src/test/java/org/springframework/graphql/execution/SchemaMappingInspectorTests.java +++ b/spring-graphql/src/test/java/org/springframework/graphql/execution/SchemaMappingInspectorTests.java @@ -534,11 +534,11 @@ class SchemaMappingInspectorTests { """; SchemaReport report = inspectSchema(schema, BookController.class); assertThatReport(report).hasUnmappedFieldCount(1).hasSkippedTypeCount(0); - assertThat(report.toString()).isEqualTo(""" - GraphQL schema inspection: - Unmapped fields: {Book=[missing]} - Unmapped registrations: {Book.fetcher=BookController#fetcher[1 args], Query.paginatedBooks=BookController#paginatedBooks[0 args], Query.bookObject=BookController#bookObject[1 args], Query.bookById=BookController#bookById[1 args]} - Skipped types: []"""); + assertThat(report.toString()) + .contains("GraphQL schema inspection:", "Unmapped fields: {Book=[missing]}", "Unmapped registrations:", + "{Book.fetcher=BookController#fetcher[1 args]", " Query.paginatedBooks=BookController#paginatedBooks[0 args]", + "Query.bookObject=BookController#bookObject[1 args]", "Query.bookById=BookController#bookById[1 args]", + "Skipped types: []"); } }