Skip to content

Commit

Permalink
Fix UnsafeByteArrayOutputStreamTest
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbumenJ committed Jan 2, 2025
1 parent df0a521 commit 06c3026
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.io.IOException;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -72,7 +73,7 @@ void testExtendLengthForBuffer() throws IOException {
@Test
void testToStringWithCharset() throws IOException {
UnsafeByteArrayOutputStream outputStream = new UnsafeByteArrayOutputStream();
outputStream.write("Hòa Bình".getBytes());
outputStream.write("Hòa Bình".getBytes(StandardCharsets.UTF_8));

assertThat(outputStream.toString("UTF-8"), is("Hòa Bình"));
}
Expand Down

0 comments on commit 06c3026

Please sign in to comment.