1414
1515package codeu .chat .common ;
1616
17- import java .util .Arrays ;
18-
1917import static org .junit .Assert .*;
18+
19+ import java .util .Arrays ;
2020import org .junit .Test ;
21- import org .junit .BeforeClass ;
22- import org .junit .AfterClass ;
2321
2422public final class SecretTest {
2523
2624 @ Test
2725 public void testParseEvenLength () {
2826
2927 final String input = "2345" ;
30- final byte [] expected = { 0x23 , 0x45 };
28+ final byte [] expected = {0x23 , 0x45 };
3129
3230 final byte [] actual = Secret .parse (input );
3331
3432 assertNotNull (actual );
3533 assertTrue (Arrays .equals (expected , actual ));
34+ }
3635
36+ @ Test
37+ public void testParseEvenLengthWithUppercaseLetters () {
38+
39+ final String input = "ABCDEF" ;
40+ final byte [] expected = {(byte ) 0xAB , (byte ) 0xCD , (byte ) 0xEF };
41+
42+ final byte [] actual = Secret .parse (input );
43+
44+ assertNotNull (actual );
45+ assertTrue (Arrays .equals (expected , actual ));
46+ }
47+
48+ @ Test
49+ public void testParseEvenLengthWithLowercaseLetters () {
50+
51+ final String input = "abcdef" ;
52+ final byte [] expected = {(byte ) 0xAB , (byte ) 0xCD , (byte ) 0xEF };
53+
54+ final byte [] actual = Secret .parse (input );
55+
56+ assertNotNull (actual );
57+ assertTrue (Arrays .equals (expected , actual ));
3758 }
3859
3960 @ Test
4061 public void testParseEvenLengthWithLeadingZero () {
4162
4263 final String input = "012345" ;
43- final byte [] expected = { 0x01 , 0x23 , 0x45 };
64+ final byte [] expected = {0x01 , 0x23 , 0x45 };
4465
4566 final byte [] actual = Secret .parse (input );
4667
@@ -52,7 +73,7 @@ public void testParseEvenLengthWithLeadingZero() {
5273 public void testParseEvenLengthWithLeadingDoubleZero () {
5374
5475 final String input = "00123456" ;
55- final byte [] expected = { 0x00 , 0x12 , 0x34 , 0x56 };
76+ final byte [] expected = {0x00 , 0x12 , 0x34 , 0x56 };
5677
5778 final byte [] actual = Secret .parse (input );
5879
@@ -64,7 +85,7 @@ public void testParseEvenLengthWithLeadingDoubleZero() {
6485 public void testParseOddLength () {
6586
6687 final String input = "12345" ;
67- final byte [] expected = { 0x01 , 0x23 , 0x45 };
88+ final byte [] expected = {0x01 , 0x23 , 0x45 };
6889
6990 final byte [] actual = Secret .parse (input );
7091
@@ -76,7 +97,7 @@ public void testParseOddLength() {
7697 public void testParseOddLengthWithLeadingZero () {
7798
7899 final String input = "0123456" ;
79- final byte [] expected = { 0x00 , 0x12 , 0x34 , 0x56 };
100+ final byte [] expected = {0x00 , 0x12 , 0x34 , 0x56 };
80101
81102 final byte [] actual = Secret .parse (input );
82103
@@ -88,7 +109,7 @@ public void testParseOddLengthWithLeadingZero() {
88109 public void testParseOddLengthWithLeadingDoubleZero () {
89110
90111 final String input = "001234567" ;
91- final byte [] expected = { 0x00 , 0x01 , 0x23 , 0x45 , 0x67 };
112+ final byte [] expected = {0x00 , 0x01 , 0x23 , 0x45 , 0x67 };
92113
93114 final byte [] actual = Secret .parse (input );
94115
0 commit comments