Utilize StandardCharsets
Closes gh-10972
This commit is contained in:
committed by
Stephane Nicoll
parent
e9c81bf702
commit
bd0dcfb172
@@ -18,6 +18,7 @@ package sample.undertow;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
import org.junit.Test;
|
||||
@@ -73,7 +74,7 @@ public class SampleUndertowApplicationTests {
|
||||
|
||||
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