Make use of StandardCharsets.UTF8

This commit is contained in:
Paul Schaub 2025-09-29 14:31:27 +02:00
parent 6b5c8c8fd2
commit 7a0b79254d
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 4 additions and 3 deletions

View file

@ -13,6 +13,7 @@ import pgp.certificate_store.exception.BadDataException;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@ -92,7 +93,7 @@ public class KeyMaterialReaderTest {
"-----END PGP PUBLIC KEY BLOCK-----";
private final KeyMaterialReader reader = new KeyMaterialReader();
private final Charset UTF8 = Charset.forName("UTF8");
private final Charset UTF8 = StandardCharsets.UTF_8;
@Test
public void readBadDataTest() {

View file

@ -13,7 +13,7 @@ import pgp.certificate_store.exception.BadDataException;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
@ -229,7 +229,7 @@ public class MergeCallbacksTest {
}
private static KeyMaterial parse(String encoding) throws BadDataException, IOException {
return reader.read(new ByteArrayInputStream(encoding.getBytes(Charset.forName("UTF8"))), null);
return reader.read(new ByteArrayInputStream(encoding.getBytes(StandardCharsets.UTF_8)), null);
}
private static void assertEncodingEquals(KeyMaterial one, KeyMaterial two) throws IOException {