File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ansi
spring-boot-tests/spring-boot-integration-tests/spring-boot-console-tests/src/intTest/java/org/springframework/boot/console Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -157,13 +157,13 @@ private static boolean detectIfAnsiCapable() {
157
157
return false ;
158
158
}
159
159
if (consoleAvailable == null ) {
160
- Console c = System .console ();
161
- if (c == null ) {
160
+ Console console = System .console ();
161
+ if (console == null ) {
162
162
return false ;
163
163
}
164
164
Method isTerminalMethod = ClassUtils .getMethodIfAvailable (Console .class , "isTerminal" );
165
165
if (isTerminalMethod != null ) {
166
- Boolean isTerminal = (Boolean ) isTerminalMethod .invoke (c );
166
+ Boolean isTerminal = (Boolean ) isTerminalMethod .invoke (console );
167
167
if (Boolean .FALSE .equals (isTerminal )) {
168
168
return false ;
169
169
}
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ class ConsoleIntegrationTests {
54
54
void runJarOn17 () {
55
55
try (GenericContainer <?> container = createContainer (JDK_17_RUNTIME )) {
56
56
container .start ();
57
- assertThat (this .output .toString (StandardCharsets .ISO_8859_1 )).contains ("System.console() is null" )
57
+ assertThat (this .output .toString (StandardCharsets .UTF_8 )).contains ("System.console() is null" )
58
58
.doesNotContain (ENCODE_START );
59
59
}
60
60
}
@@ -63,7 +63,7 @@ void runJarOn17() {
63
63
void runJarOn22 () {
64
64
try (GenericContainer <?> container = createContainer (JDK_22_RUNTIME )) {
65
65
container .start ();
66
- assertThat (this .output .toString (StandardCharsets .ISO_8859_1 )).doesNotContain ("System.console() is null" )
66
+ assertThat (this .output .toString (StandardCharsets .UTF_8 )).doesNotContain ("System.console() is null" )
67
67
.doesNotContain (ENCODE_START );
68
68
}
69
69
}
You can’t perform that action at this time.
0 commit comments