Make report format tests more reliable

This commit ensures that report format tests don't break when the
ordering of reported missing fields change.
This commit is contained in:
Brian Clozel
2023-07-17 16:18:38 +02:00
parent 435ef4a938
commit 9983b1f111

View File

@@ -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: []");
}
}