aboutsummaryrefslogtreecommitdiff
path: root/src/test/model/asn1/OctetStringTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/model/asn1/OctetStringTest.java')
-rw-r--r--src/test/model/asn1/OctetStringTest.java25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/test/model/asn1/OctetStringTest.java b/src/test/model/asn1/OctetStringTest.java
index 9e6e8a9..91825e9 100644
--- a/src/test/model/asn1/OctetStringTest.java
+++ b/src/test/model/asn1/OctetStringTest.java
@@ -2,36 +2,33 @@ package model.asn1;
import model.asn1.exceptions.ParseException;
import model.asn1.parsing.BytesReader;
-import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import java.util.stream.Collectors;
-import java.util.stream.IntStream;
-
-import static org.junit.jupiter.api.Assertions.*;
+import static org.junit.jupiter.api.Assertions.assertArrayEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
public class OctetStringTest {
@Test
void testConstructor() {
- assertArrayEquals(new Byte[]{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05 },
- new OctetString(OctetString.TAG, null, new Byte[]{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05 })
+ assertArrayEquals(new Byte[]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05},
+ new OctetString(OctetString.TAG, null, new Byte[]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05})
.getBytes());
- assertArrayEquals(new Byte[]{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05 },
- new OctetString(OctetString.TAG, null, new Byte[]{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05 })
+ assertArrayEquals(new Byte[]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05},
+ new OctetString(OctetString.TAG, null, new Byte[]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05})
.encodeValueDER());
}
@Test
void testEncode() throws ParseException {
- assertArrayEquals(new Byte[]{ 0x04, 0x06, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05 },
- new OctetString(OctetString.TAG, null, new Byte[]{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05 })
+ assertArrayEquals(new Byte[]{0x04, 0x06, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05},
+ new OctetString(OctetString.TAG, null, new Byte[]{0x00, 0x01, 0x02, 0x03, 0x04, 0x05})
.encodeDER());
}
@Test
void testParse() throws ParseException {
- assertArrayEquals(new Byte[]{ 0x0A, 0x0B, 0x0C },
- new OctetString(new BytesReader(new Byte[]{ 0x4, 3, 0x0A, 0x0B, 0x0C }), false)
+ assertArrayEquals(new Byte[]{0x0A, 0x0B, 0x0C},
+ new OctetString(new BytesReader(new Byte[]{0x4, 3, 0x0A, 0x0B, 0x0C}), false)
.getBytes());
}
@@ -39,6 +36,6 @@ public class OctetStringTest {
void testParseFail() {
// EOF
assertThrows(ParseException.class, () ->
- new OctetString(new BytesReader(new Byte[]{ 0x4, 2, 0x0 }), false));
+ new OctetString(new BytesReader(new Byte[]{0x4, 2, 0x0}), false));
}
}