Use Java 17 feature (#2341)

This was somehow missed in #2333

<!-- Reviewable:start -->
- - -
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/google/nomulus/2341)
<!-- Reviewable:end -->
This commit is contained in:
Lai Jiang 2024-02-28 16:39:31 -05:00 committed by GitHub
parent bf877f469c
commit f82e8e006d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -45,10 +45,9 @@ class TeeOutputStreamTest {
outputB.write("b".getBytes(UTF_8)); outputB.write("b".getBytes(UTF_8));
outputC.write("c".getBytes(UTF_8)); outputC.write("c".getBytes(UTF_8));
// Check the results. // Check the results.
// TODO: Use toString(StandardCharsets.UTF_8) once we can use Java 17. assertThat(outputA.toString(UTF_8)).isEqualTo("hello world!a");
assertThat(outputA.toString("UTF-8")).isEqualTo("hello world!a"); assertThat(outputB.toString(UTF_8)).isEqualTo("hello world!b");
assertThat(outputB.toString("UTF-8")).isEqualTo("hello world!b"); assertThat(outputC.toString(UTF_8)).isEqualTo("hello world!c");
assertThat(outputC.toString("UTF-8")).isEqualTo("hello world!c");
} }
@Test @Test