Commit e6d60d93 authored by Andy Wilkinson's avatar Andy Wilkinson

Ensure the use of UTF-8 encoding in ImageBannerTests

Closes gh-18301
parent ec2483e8
......@@ -18,6 +18,7 @@ package org.springframework.boot;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
......@@ -204,8 +205,13 @@ class ImageBannerTests {
ConfigurableEnvironment environment = new MockEnvironment();
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(environment, properties);
ByteArrayOutputStream out = new ByteArrayOutputStream();
banner.printBanner(environment, getClass(), new PrintStream(out));
return out.toString();
try {
banner.printBanner(environment, getClass(), new PrintStream(out, false, "UTF-8"));
return out.toString("UTF-8");
}
catch (UnsupportedEncodingException ex) {
throw new IllegalStateException(ex);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment