From 28fa18278c1f3a87722d5e8b78f581526a30bb38 Mon Sep 17 00:00:00 2001 From: Yuuta Liang Date: Sat, 14 Oct 2023 05:35:17 +0800 Subject: Fix lint Signed-off-by: Yuuta Liang --- src/test/model/asn1/IA5StringTest.java | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/test/model/asn1/IA5StringTest.java') diff --git a/src/test/model/asn1/IA5StringTest.java b/src/test/model/asn1/IA5StringTest.java index dfaa1aa..8bec6c4 100644 --- a/src/test/model/asn1/IA5StringTest.java +++ b/src/test/model/asn1/IA5StringTest.java @@ -32,25 +32,25 @@ public class IA5StringTest { void testIllegalStrings() { assertThrows(ParseException.class, () -> new IA5String(IA5String.TAG, null, - stringToTest + new String(new byte[]{ -128 }, StandardCharsets.UTF_8))); + stringToTest + new String(new byte[]{-128}, StandardCharsets.UTF_8))); assertThrows(ParseException.class, () -> new IA5String(IA5String.TAG, null, - stringToTest + new String(new byte[]{ -1 }, StandardCharsets.UTF_8))); + stringToTest + new String(new byte[]{-1}, StandardCharsets.UTF_8))); } @Test void testEncode() throws ParseException { assertArrayEquals( - new Byte[] { 0x00, 0x01, 0x02 }, - new IA5String(IA5String.TAG, null, new String(new byte[]{ 0, 1, 2}, StandardCharsets.UTF_8)) + new Byte[]{0x00, 0x01, 0x02}, + new IA5String(IA5String.TAG, null, new String(new byte[]{0, 1, 2}, StandardCharsets.UTF_8)) .encodeValueDER()); assertArrayEquals( - new Byte[] { + new Byte[]{ 0x16, 0x02, // Tag - Length 0x68, 0x69 // Value }, new IA5String(IA5String.TAG, null, "hi").encodeDER()); assertArrayEquals( - new Byte[] { + new Byte[]{ -85, 0x05, // Parent Tag - Length 0x16, 0x03, // Inner Tag - Length 0x68, 0x69, 0x69 // Value @@ -62,18 +62,18 @@ public class IA5StringTest { @Test void testParse() throws ParseException { assertEquals("123", - new IA5String(new BytesReader(new Byte[]{ 0x16, 3, '1', '2', '3' }), false) + new IA5String(new BytesReader(new Byte[]{0x16, 3, '1', '2', '3'}), false) .getString()); assertEquals("", - new IA5String(new BytesReader(new Byte[]{ 0x16, 0 }), false) + new IA5String(new BytesReader(new Byte[]{0x16, 0}), false) .getString()); } @Test void testParseFail() { - assertThrows(ParseException.class, () -> - new IA5String(new BytesReader(new Byte[]{ 0x16, 3, '1', '2' }), false)); - assertThrows(ParseException.class, () -> - new IA5String(new BytesReader(new Byte[]{ 0x16, 2, '1', -128 }), false)); + assertThrows(ParseException.class, () -> + new IA5String(new BytesReader(new Byte[]{0x16, 3, '1', '2'}), false)); + assertThrows(ParseException.class, () -> + new IA5String(new BytesReader(new Byte[]{0x16, 2, '1', -128}), false)); } } -- cgit v1.2.3