mirror of
https://codeberg.org/PGPainless/cert-d-pgpainless.git
synced 2025-12-05 04:41:09 +01:00
Make use of StandardCharsets.UTF8
This commit is contained in:
parent
6b5c8c8fd2
commit
7a0b79254d
2 changed files with 4 additions and 3 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue