mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Make JSON assertions more strict
This commit is contained in:
+2
-2
@@ -144,7 +144,7 @@ public class FileNativeConfigurationWriterTests {
|
||||
],
|
||||
"queriedMethods": [
|
||||
{ "name": "<init>", "parameterTypes": [ "java.util.List", "boolean", "org.springframework.util.MimeType" ] },
|
||||
{ "name": "getDefaultCharset" }
|
||||
{ "name": "getDefaultCharset", "parameterTypes": [ ] }
|
||||
]
|
||||
}
|
||||
]""", "reflect-config.json");
|
||||
@@ -186,7 +186,7 @@ public class FileNativeConfigurationWriterTests {
|
||||
private void assertEquals(String expectedString, String filename) throws IOException, JSONException {
|
||||
Path jsonFile = tempDir.resolve("META-INF").resolve("native-image").resolve(filename);
|
||||
String content = new String(Files.readAllBytes(jsonFile));
|
||||
JSONAssert.assertEquals(expectedString, content, JSONCompareMode.LENIENT);
|
||||
JSONAssert.assertEquals(expectedString, content, JSONCompareMode.NON_EXTENSIBLE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ public class JavaSerializationHintsWriterTests {
|
||||
StringWriter out = new StringWriter();
|
||||
BasicJsonWriter writer = new BasicJsonWriter(out, "\t");
|
||||
JavaSerializationHintsWriter.INSTANCE.write(writer, hints);
|
||||
JSONAssert.assertEquals(expectedString, out.toString(), JSONCompareMode.LENIENT);
|
||||
JSONAssert.assertEquals(expectedString, out.toString(), JSONCompareMode.NON_EXTENSIBLE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ public class ProxyHintsWriterTests {
|
||||
StringWriter out = new StringWriter();
|
||||
BasicJsonWriter writer = new BasicJsonWriter(out, "\t");
|
||||
ProxyHintsWriter.INSTANCE.write(writer, hints);
|
||||
JSONAssert.assertEquals(expectedString, out.toString(), JSONCompareMode.LENIENT);
|
||||
JSONAssert.assertEquals(expectedString, out.toString(), JSONCompareMode.NON_EXTENSIBLE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -95,7 +95,7 @@ public class ReflectionHintsWriterTests {
|
||||
],
|
||||
"queriedMethods": [
|
||||
{ "name": "<init>", "parameterTypes": [ "java.util.List", "boolean", "org.springframework.util.MimeType" ] },
|
||||
{ "name": "getDefaultCharset" }
|
||||
{ "name": "getDefaultCharset", "parameterTypes": [ ] }
|
||||
]
|
||||
}
|
||||
]""", hints);
|
||||
@@ -191,7 +191,7 @@ public class ReflectionHintsWriterTests {
|
||||
StringWriter out = new StringWriter();
|
||||
BasicJsonWriter writer = new BasicJsonWriter(out, "\t");
|
||||
ReflectionHintsWriter.INSTANCE.write(writer, hints);
|
||||
JSONAssert.assertEquals(expectedString, out.toString(), JSONCompareMode.LENIENT);
|
||||
JSONAssert.assertEquals(expectedString, out.toString(), JSONCompareMode.NON_EXTENSIBLE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -120,7 +120,7 @@ public class ResourceHintsWriterTests {
|
||||
StringWriter out = new StringWriter();
|
||||
BasicJsonWriter writer = new BasicJsonWriter(out, "\t");
|
||||
ResourceHintsWriter.INSTANCE.write(writer, hints);
|
||||
JSONAssert.assertEquals(expectedString, out.toString(), JSONCompareMode.LENIENT);
|
||||
JSONAssert.assertEquals(expectedString, out.toString(), JSONCompareMode.NON_EXTENSIBLE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user