Add support for Charset for property value code generation
Closes gh-29186
This commit is contained in:
@@ -18,6 +18,8 @@ package org.springframework.beans.factory.aot;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -196,6 +198,19 @@ class BeanDefinitionPropertyValueCodeGeneratorTests {
|
||||
|
||||
}
|
||||
|
||||
@Nested
|
||||
class CharsetTests {
|
||||
|
||||
@Test
|
||||
void generateWhenCharset() {
|
||||
compile(StandardCharsets.UTF_8, (instance, compiled) -> {
|
||||
assertThat(instance).isEqualTo(Charset.forName("UTF-8"));
|
||||
assertThat(compiled.getSourceFile()).contains("\"UTF-8\"");
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Nested
|
||||
class EnumTests {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user