mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-28 13:09:09 +00:00
Utilize StandardCharsets
Closes gh-10972
This commit is contained in:
committed by
Stephane Nicoll
parent
e9c81bf702
commit
bd0dcfb172
+2
-2
@@ -17,7 +17,7 @@
|
||||
package sample.jetty;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
import org.junit.Test;
|
||||
@@ -69,7 +69,7 @@ public class SampleJettyApplicationTests {
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
try (GZIPInputStream inflater = new GZIPInputStream(
|
||||
new ByteArrayInputStream(entity.getBody()))) {
|
||||
assertThat(StreamUtils.copyToString(inflater, Charset.forName("UTF-8")))
|
||||
assertThat(StreamUtils.copyToString(inflater, StandardCharsets.UTF_8))
|
||||
.isEqualTo("Hello World");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user