|
12 | 12 | import org.junit.jupiter.params.provider.MethodSource; |
13 | 13 |
|
14 | 14 | @Execution(ExecutionMode.CONCURRENT) |
15 | | -public class HexDumpTest { |
| 15 | +class HexDumpTest { |
16 | 16 |
|
17 | | - @DisplayName("Test HexDump.toHex(byte[] buf)") |
18 | | - @ParameterizedTest(name = "{index} => expected: {0}, buf: {1}") |
19 | | - @MethodSource("testToHex1Sources") |
20 | | - public void testToHex1(String expected, byte[] buf) { |
21 | | - assertEquals(expected, HexDump.toHex(buf)); |
22 | | - } |
| 17 | + @DisplayName("Test HexDump.toHex(byte[] buf)") |
| 18 | + @ParameterizedTest(name = "{index} => expected: {0}, buf: {1}") |
| 19 | + @MethodSource("testToHex1Sources") |
| 20 | + void testToHex1(String expected, byte[] buf) { |
| 21 | + assertEquals(expected, HexDump.toHex(buf)); |
| 22 | + } |
23 | 23 |
|
24 | | - static Stream<Arguments> testToHex1Sources() { |
25 | | - return Stream.of( |
| 24 | + static Stream<Arguments> testToHex1Sources() { |
| 25 | + return Stream.of( |
26 | 26 | arguments("'fooBar'", new byte[] {'f', 'o', 'o', 'B', 'a', 'r'}), |
27 | 27 | arguments("0xc3", new byte[] {(byte) 'Ã'}), |
28 | 28 | arguments("0xac '100'", new byte[] {(byte) '€', '1', '0', '0'}), |
29 | 29 | arguments("'1' 0xf7 '2'", new byte[] {'1', (byte) '÷', '2'}), |
30 | 30 | arguments("'foo' 0x0a\n'Bar'", new byte[] {'f', 'o', 'o', '\n', 'B', 'a', 'r'}) |
31 | | - ); |
32 | | - } |
| 31 | + ); |
| 32 | + } |
33 | 33 |
|
34 | | - @DisplayName("Test HexDump.toHex(byte[] buf, int start, int len)") |
35 | | - @ParameterizedTest(name = "{index} => expected: {0}, buf: {1}, start: {2}, len: {3}") |
36 | | - @MethodSource("testToHex2Sources") |
37 | | - public void testToHex2(String expected, byte[] buf, int start, int len) { |
38 | | - assertEquals(expected, HexDump.toHex(buf, start, len)); |
39 | | - } |
| 34 | + @DisplayName("Test HexDump.toHex(byte[] buf, int start, int len)") |
| 35 | + @ParameterizedTest(name = "{index} => expected: {0}, buf: {1}, start: {2}, len: {3}") |
| 36 | + @MethodSource("testToHex2Sources") |
| 37 | + void testToHex2(String expected, byte[] buf, int start, int len) { |
| 38 | + assertEquals(expected, HexDump.toHex(buf, start, len)); |
| 39 | + } |
40 | 40 |
|
41 | | - static Stream<Arguments> testToHex2Sources() { |
42 | | - return Stream.of( |
| 41 | + static Stream<Arguments> testToHex2Sources() { |
| 42 | + return Stream.of( |
43 | 43 | arguments("'ooBa'", new byte[] {'f', 'o', 'o', 'B', 'a', 'r'}, 1, 4), |
44 | 44 | arguments("0xc3", new byte[] {(byte) 'Ã'}, 0, 1), |
45 | 45 | arguments("0xac '10'", new byte[] {(byte) '€', '1', '0', '0'}, 0, 3), |
46 | 46 | arguments("0xf7 '2'", new byte[] {'1', (byte) '÷', '2'}, 1, 2), |
47 | 47 | arguments("'Bar'", new byte[] {'f', 'o', 'o', '\n', 'B', 'a', 'r'}, 4, 3), |
48 | 48 | arguments("", new byte[] {'f', 'o', 'o', 'B', 'a', 'r'}, 0, 0) |
49 | | - ); |
50 | | - } |
| 49 | + ); |
| 50 | + } |
51 | 51 | } |
0 commit comments