mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 16:30:28 +00:00
Polishing
See gh-36972
This commit is contained in:
+8
-8
@@ -24,7 +24,6 @@ import java.nio.file.Path;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.io.TempDir;
|
||||
import org.skyscreamer.jsonassert.JSONAssert;
|
||||
@@ -64,7 +63,7 @@ class FileNativeConfigurationWriterTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void serializationConfig() throws IOException, JSONException {
|
||||
void serializationConfig() throws Exception {
|
||||
FileNativeConfigurationWriter generator = new FileNativeConfigurationWriter(tempDir);
|
||||
RuntimeHints hints = new RuntimeHints();
|
||||
ReflectionHints reflectionHints = hints.reflection();
|
||||
@@ -82,7 +81,7 @@ class FileNativeConfigurationWriterTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void proxyConfig() throws IOException, JSONException {
|
||||
void proxyConfig() throws Exception {
|
||||
FileNativeConfigurationWriter generator = new FileNativeConfigurationWriter(tempDir);
|
||||
RuntimeHints hints = new RuntimeHints();
|
||||
ProxyHints proxyHints = hints.proxies();
|
||||
@@ -100,7 +99,7 @@ class FileNativeConfigurationWriterTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void reflectionConfig() throws IOException, JSONException {
|
||||
void reflectionConfig() throws Exception {
|
||||
FileNativeConfigurationWriter generator = new FileNativeConfigurationWriter(tempDir);
|
||||
RuntimeHints hints = new RuntimeHints();
|
||||
ReflectionHints reflectionHints = hints.reflection();
|
||||
@@ -139,7 +138,7 @@ class FileNativeConfigurationWriterTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void jniConfig() throws IOException, JSONException {
|
||||
void jniConfig() throws Exception {
|
||||
// same format as reflection so just test basic file generation
|
||||
FileNativeConfigurationWriter generator = new FileNativeConfigurationWriter(tempDir);
|
||||
RuntimeHints hints = new RuntimeHints();
|
||||
@@ -158,7 +157,7 @@ class FileNativeConfigurationWriterTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void resourceConfig() throws IOException, JSONException {
|
||||
void resourceConfig() throws Exception {
|
||||
FileNativeConfigurationWriter generator = new FileNativeConfigurationWriter(tempDir);
|
||||
RuntimeHints hints = new RuntimeHints();
|
||||
ResourceHints resourceHints = hints.resources();
|
||||
@@ -177,7 +176,7 @@ class FileNativeConfigurationWriterTests {
|
||||
}""");
|
||||
}
|
||||
|
||||
@Test
|
||||
@Test // gh-36972
|
||||
void resourceConfigWithNonAsciiPatternIsWrittenAsUtf8() throws IOException {
|
||||
FileNativeConfigurationWriter generator = new FileNativeConfigurationWriter(tempDir);
|
||||
RuntimeHints hints = new RuntimeHints();
|
||||
@@ -202,7 +201,8 @@ class FileNativeConfigurationWriterTests {
|
||||
assertThat(jsonFile.toFile()).exists();
|
||||
}
|
||||
|
||||
private void assertEquals(String expectedString) throws IOException, JSONException {
|
||||
|
||||
private static void assertEquals(String expectedString) throws Exception {
|
||||
Path jsonFile = tempDir.resolve("META-INF").resolve("native-image").resolve("reachability-metadata.json");
|
||||
String content = Files.readString(jsonFile);
|
||||
JSONAssert.assertEquals(expectedString, content, JSONCompareMode.NON_EXTENSIBLE);
|
||||
|
||||
Reference in New Issue
Block a user