aboutsummaryrefslogtreecommitdiff
path: root/src/test/model/asn1/IA5StringTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/model/asn1/IA5StringTest.java')
-rw-r--r--src/test/model/asn1/IA5StringTest.java24
1 files changed, 12 insertions, 12 deletions
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));
}
}