Skip to content

Commit fdad06f

Browse files
committed
test: clean test code
1 parent d6b903e commit fdad06f

File tree

29 files changed

+274
-276
lines changed

29 files changed

+274
-276
lines changed

src/test/java/com/adventofcode/flashk/common/test/constants/TestDisplayName.java

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,39 @@ public final class TestDisplayName {
55
private TestDisplayName() {}
66

77
// Day display name
8-
public final static String DAY_XX = "Day XX";
9-
public final static String DAY_01 = "Day 01";
10-
public final static String DAY_02 = "Day 02";
11-
public final static String DAY_03 = "Day 03";
12-
public final static String DAY_04 = "Day 04";
13-
public final static String DAY_05 = "Day 05";
14-
public final static String DAY_06 = "Day 06";
15-
public final static String DAY_07 = "Day 07";
16-
public final static String DAY_08 = "Day 08";
17-
public final static String DAY_09 = "Day 09";
18-
public final static String DAY_10 = "Day 10";
19-
public final static String DAY_11 = "Day 11";
20-
public final static String DAY_12 = "Day 12";
21-
public final static String DAY_13 = "Day 13";
22-
public final static String DAY_14 = "Day 14";
23-
public final static String DAY_15 = "Day 15";
24-
public final static String DAY_16 = "Day 16";
25-
public final static String DAY_17 = "Day 17";
26-
public final static String DAY_18 = "Day 18";
27-
public final static String DAY_19 = "Day 19";
28-
public final static String DAY_20 = "Day 20";
29-
public final static String DAY_21 = "Day 21";
30-
public final static String DAY_22 = "Day 22";
31-
public final static String DAY_23 = "Day 23";
32-
public final static String DAY_24 = "Day 24";
33-
public final static String DAY_25 = "Day 25";
8+
public static final String DAY_01 = "Day 01";
9+
public static final String DAY_02 = "Day 02";
10+
public static final String DAY_03 = "Day 03";
11+
public static final String DAY_04 = "Day 04";
12+
public static final String DAY_05 = "Day 05";
13+
public static final String DAY_06 = "Day 06";
14+
public static final String DAY_07 = "Day 07";
15+
public static final String DAY_08 = "Day 08";
16+
public static final String DAY_09 = "Day 09";
17+
public static final String DAY_10 = "Day 10";
18+
public static final String DAY_11 = "Day 11";
19+
public static final String DAY_12 = "Day 12";
20+
public static final String DAY_13 = "Day 13";
21+
public static final String DAY_14 = "Day 14";
22+
public static final String DAY_15 = "Day 15";
23+
public static final String DAY_16 = "Day 16";
24+
public static final String DAY_17 = "Day 17";
25+
public static final String DAY_18 = "Day 18";
26+
public static final String DAY_19 = "Day 19";
27+
public static final String DAY_20 = "Day 20";
28+
public static final String DAY_21 = "Day 21";
29+
public static final String DAY_22 = "Day 22";
30+
public static final String DAY_23 = "Day 23";
31+
public static final String DAY_24 = "Day 24";
32+
public static final String DAY_25 = "Day 25";
3433

35-
// Single test display name
36-
public final static String PART_ONE_SAMPLE = "Part 1 - Sample data";
37-
public final static String PART_ONE_SINGLE_SAMPLE = "Part 1 - Single sample data";
38-
public final static String PART_ONE_INPUT = "Part 1 - Input data";
39-
public final static String PART_ONE_DEBUG = "Part 1 - Debug";
40-
public final static String PART_TWO_SAMPLE = "Part 2 - Sample data";
41-
public final static String PART_TWO_INPUT = "Part 2 - Input data";
42-
public final static String PART_TWO_DEBUG = "Part 2 - Debug";
34+
// Test part display names
35+
public static final String PART_1_SAMPLE = "Part 1 - Sample data";
36+
public static final String PART_1_INPUT = "Part 1 - Input data";
37+
public static final String PART_1_DEBUG = "Part 1 - Debug";
38+
public static final String PART_2_SAMPLE = "Part 2 - Sample data";
39+
public static final String PART_2_INPUT = "Part 2 - Input data";
40+
public static final String PART_2_DEBUG = "Part 2 - Debug";
41+
42+
public static final String PART_ONE_SINGLE_SAMPLE = "Part 1 - Single sample data";
4343
}

src/test/java/com/adventofcode/flashk/common/test/constants/TestFilename.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ public final class TestFilename {
55
private TestFilename() {}
66

77
// Common filenames used by all tests
8-
public final static String INPUT_FILE = "data.input";
9-
public final static String INPUT_FILE_SAMPLE = "sample.input";
10-
public final static String INPUT_FILE_SAMPLE_PART_2 = "sample_part_2.input";
11-
public final static String INPUT_FILE_SINGLE_SAMPLE = "single_sample.input";
8+
public static final String INPUT_FILE = "data.input";
9+
public static final String INPUT_FILE_SAMPLE = "sample.input";
10+
public static final String INPUT_FILE_SAMPLE_PART_2 = "sample_part_2.input";
11+
public static final String INPUT_FILE_SINGLE_SAMPLE = "single_sample.input";
1212

1313
// Other tests
14-
public final static String ARRAY_JSON = "array.json";
15-
public final static String INVALID_JSON = "invalid.json";
14+
public static final String ARRAY_JSON = "array.json";
15+
public static final String INVALID_JSON = "invalid.json";
1616

1717
}

src/test/java/com/adventofcode/flashk/common/test/constants/TestFolder.java

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,32 @@ public final class TestFolder {
55
private TestFolder() {}
66

77
// Folders
8-
public final static String COMMON = "common";
9-
public final static String DAY_XX = "day_xx";
10-
public final static String DAY_01 = "day_01";
11-
public final static String DAY_02 = "day_02";
12-
public final static String DAY_03 = "day_03";
13-
public final static String DAY_04 = "day_04";
14-
public final static String DAY_05 = "day_05";
15-
public final static String DAY_06 = "day_06";
16-
public final static String DAY_07 = "day_07";
17-
public final static String DAY_08 = "day_08";
18-
public final static String DAY_09 = "day_09";
19-
public final static String DAY_10 = "day_10";
20-
public final static String DAY_11 = "day_11";
21-
public final static String DAY_12 = "day_12";
22-
public final static String DAY_13 = "day_13";
23-
public final static String DAY_14 = "day_14";
24-
public final static String DAY_15 = "day_15";
25-
public final static String DAY_16 = "day_16";
26-
public final static String DAY_17 = "day_17";
27-
public final static String DAY_18 = "day_18";
28-
public final static String DAY_19 = "day_19";
29-
public final static String DAY_20 = "day_20";
30-
public final static String DAY_21 = "day_21";
31-
public final static String DAY_22 = "day_22";
32-
public final static String DAY_23 = "day_23";
33-
public final static String DAY_24 = "day_24";
34-
public final static String DAY_25 = "day_25";
8+
public static final String COMMON = "common";
9+
public static final String DAY_01 = "day_01";
10+
public static final String DAY_02 = "day_02";
11+
public static final String DAY_03 = "day_03";
12+
public static final String DAY_04 = "day_04";
13+
public static final String DAY_05 = "day_05";
14+
public static final String DAY_06 = "day_06";
15+
public static final String DAY_07 = "day_07";
16+
public static final String DAY_08 = "day_08";
17+
public static final String DAY_09 = "day_09";
18+
public static final String DAY_10 = "day_10";
19+
public static final String DAY_11 = "day_11";
20+
public static final String DAY_12 = "day_12";
21+
public static final String DAY_13 = "day_13";
22+
public static final String DAY_14 = "day_14";
23+
public static final String DAY_15 = "day_15";
24+
public static final String DAY_16 = "day_16";
25+
public static final String DAY_17 = "day_17";
26+
public static final String DAY_18 = "day_18";
27+
public static final String DAY_19 = "day_19";
28+
public static final String DAY_20 = "day_20";
29+
public static final String DAY_21 = "day_21";
30+
public static final String DAY_22 = "day_22";
31+
public static final String DAY_23 = "day_23";
32+
public static final String DAY_24 = "day_24";
33+
public static final String DAY_25 = "day_25";
3534

3635

3736

src/test/java/com/adventofcode/flashk/common/test/constants/TestTag.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
public final class TestTag {
44

5-
public TestTag() {}
5+
private TestTag() {}
66

7-
public final static String INPUT = "input";
8-
public final static String SAMPLE = "sample";
9-
public final static String PART_ONE = "part-1";
10-
public final static String PART_TWO = "part-2";
11-
public final static String DEBUG = "debug";
7+
public static final String INPUT = "input";
8+
public static final String SAMPLE = "sample";
9+
public static final String PART_1 = "part-1";
10+
public static final String PART_2 = "part-2";
11+
public static final String DEBUG = "debug";
1212

1313
}

src/test/java/com/adventofcode/flashk/day01/Day01Test.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ public class Day01Test extends PuzzleTest {
2626

2727
@Test
2828
@Order(1)
29-
@Tag(TestTag.PART_ONE)
29+
@Tag(TestTag.PART_1)
3030
@Tag(TestTag.SAMPLE)
31-
@DisplayName(TestDisplayName.PART_ONE_SAMPLE)
31+
@DisplayName(TestDisplayName.PART_1_SAMPLE)
3232
public void testSolvePart1Sample() {
3333

3434
// Read input file
@@ -41,9 +41,9 @@ public void testSolvePart1Sample() {
4141

4242
@Test
4343
@Order(2)
44-
@Tag(TestTag.PART_ONE)
44+
@Tag(TestTag.PART_1)
4545
@Tag(TestTag.INPUT)
46-
@DisplayName(TestDisplayName.PART_ONE_INPUT)
46+
@DisplayName(TestDisplayName.PART_1_INPUT)
4747
public void testSolvePart1Input() {
4848

4949
// Read input file
@@ -56,9 +56,9 @@ public void testSolvePart1Input() {
5656

5757
@Test
5858
@Order(3)
59-
@Tag(TestTag.PART_TWO)
59+
@Tag(TestTag.PART_2)
6060
@Tag(TestTag.SAMPLE)
61-
@DisplayName(TestDisplayName.PART_TWO_SAMPLE)
61+
@DisplayName(TestDisplayName.PART_2_SAMPLE)
6262
public void testSolvePart2Sample() {
6363

6464
// Read input file
@@ -71,9 +71,9 @@ public void testSolvePart2Sample() {
7171

7272
@Test
7373
@Order(4)
74-
@Tag(TestTag.PART_TWO)
74+
@Tag(TestTag.PART_2)
7575
@Tag(TestTag.INPUT)
76-
@DisplayName(TestDisplayName.PART_TWO_INPUT)
76+
@DisplayName(TestDisplayName.PART_2_INPUT)
7777
public void testSolvePart2Input() {
7878

7979
// Read input file

src/test/java/com/adventofcode/flashk/day02/Day02Test.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ public class Day02Test extends PuzzleTest {
2828

2929
@Test
3030
@Order(1)
31-
@Tag(TestTag.PART_ONE)
31+
@Tag(TestTag.PART_1)
3232
@Tag(TestTag.SAMPLE)
33-
@DisplayName(TestDisplayName.PART_ONE_SAMPLE)
33+
@DisplayName(TestDisplayName.PART_1_SAMPLE)
3434
public void testSolvePart1Sample() {
3535

3636
// Read input file
@@ -42,9 +42,9 @@ public void testSolvePart1Sample() {
4242

4343
@Test
4444
@Order(2)
45-
@Tag(TestTag.PART_ONE)
45+
@Tag(TestTag.PART_1)
4646
@Tag(TestTag.INPUT)
47-
@DisplayName(TestDisplayName.PART_ONE_INPUT)
47+
@DisplayName(TestDisplayName.PART_1_INPUT)
4848
public void testSolvePart1Input() {
4949

5050
// Read input file
@@ -57,9 +57,9 @@ public void testSolvePart1Input() {
5757

5858
@Test
5959
@Order(3)
60-
@Tag(TestTag.PART_TWO)
60+
@Tag(TestTag.PART_2)
6161
@Tag(TestTag.SAMPLE)
62-
@DisplayName(TestDisplayName.PART_TWO_SAMPLE)
62+
@DisplayName(TestDisplayName.PART_2_SAMPLE)
6363
public void testSolvePart2Sample() {
6464

6565
// Read input file
@@ -71,9 +71,9 @@ public void testSolvePart2Sample() {
7171

7272
@Test
7373
@Order(4)
74-
@Tag(TestTag.PART_TWO)
74+
@Tag(TestTag.PART_2)
7575
@Tag(TestTag.INPUT)
76-
@DisplayName(TestDisplayName.PART_TWO_INPUT)
76+
@DisplayName(TestDisplayName.PART_2_INPUT)
7777
public void testSolvePart2Input() {
7878

7979
// Read input file

src/test/java/com/adventofcode/flashk/day03/Day03Test.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ class Day03Test extends PuzzleTest {
2727

2828
@Test
2929
@Order(1)
30-
@Tag(TestTag.PART_ONE)
30+
@Tag(TestTag.PART_1)
3131
@Tag(TestTag.SAMPLE)
32-
@DisplayName(TestDisplayName.PART_ONE_SAMPLE)
32+
@DisplayName(TestDisplayName.PART_1_SAMPLE)
3333
public void testSolvePart1Sample() {
3434

3535
// Read input file
@@ -42,9 +42,9 @@ public void testSolvePart1Sample() {
4242

4343
@Test
4444
@Order(2)
45-
@Tag(TestTag.PART_ONE)
45+
@Tag(TestTag.PART_1)
4646
@Tag(TestTag.INPUT)
47-
@DisplayName(TestDisplayName.PART_ONE_INPUT)
47+
@DisplayName(TestDisplayName.PART_1_INPUT)
4848
public void testSolvePart1Input() {
4949

5050
// Read input file
@@ -58,9 +58,9 @@ public void testSolvePart1Input() {
5858

5959
@Test
6060
@Order(2)
61-
@Tag(TestTag.PART_TWO)
61+
@Tag(TestTag.PART_2)
6262
@Tag(TestTag.INPUT)
63-
@DisplayName(TestDisplayName.PART_TWO_DEBUG)
63+
@DisplayName(TestDisplayName.PART_2_DEBUG)
6464
void testSolvePart2InputByLines() {
6565

6666
// Read input file
@@ -75,9 +75,9 @@ void testSolvePart2InputByLines() {
7575

7676
@Test
7777
@Order(3)
78-
@Tag(TestTag.PART_TWO)
78+
@Tag(TestTag.PART_2)
7979
@Tag(TestTag.SAMPLE)
80-
@DisplayName(TestDisplayName.PART_TWO_SAMPLE)
80+
@DisplayName(TestDisplayName.PART_2_SAMPLE)
8181
public void testSolvePart2Sample() {
8282

8383
// Read input file
@@ -89,9 +89,9 @@ public void testSolvePart2Sample() {
8989

9090
@Test
9191
@Order(4)
92-
@Tag(TestTag.PART_TWO)
92+
@Tag(TestTag.PART_2)
9393
@Tag(TestTag.INPUT)
94-
@DisplayName(TestDisplayName.PART_TWO_INPUT)
94+
@DisplayName(TestDisplayName.PART_2_INPUT)
9595
public void testSolvePart2Input() {
9696

9797
// Read input file

src/test/java/com/adventofcode/flashk/day04/Day04Test.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ public class Day04Test extends PuzzleTest {
2424

2525
@Test
2626
@Order(1)
27-
@Tag(TestTag.PART_ONE)
27+
@Tag(TestTag.PART_1)
2828
@Tag(TestTag.SAMPLE)
29-
@DisplayName(TestDisplayName.PART_ONE_SAMPLE)
29+
@DisplayName(TestDisplayName.PART_1_SAMPLE)
3030
public void testSolvePart1Sample() {
3131

3232
// Read input file
@@ -38,9 +38,9 @@ public void testSolvePart1Sample() {
3838

3939
@Test
4040
@Order(2)
41-
@Tag(TestTag.PART_ONE)
41+
@Tag(TestTag.PART_1)
4242
@Tag(TestTag.INPUT)
43-
@DisplayName(TestDisplayName.PART_ONE_INPUT)
43+
@DisplayName(TestDisplayName.PART_1_INPUT)
4444
public void testSolvePart1Input() {
4545

4646
// Read input file
@@ -53,9 +53,9 @@ public void testSolvePart1Input() {
5353

5454
@Test
5555
@Order(3)
56-
@Tag(TestTag.PART_TWO)
56+
@Tag(TestTag.PART_2)
5757
@Tag(TestTag.SAMPLE)
58-
@DisplayName(TestDisplayName.PART_TWO_SAMPLE)
58+
@DisplayName(TestDisplayName.PART_2_SAMPLE)
5959
public void testSolvePart2Sample() {
6060

6161
// Read input file
@@ -67,9 +67,9 @@ public void testSolvePart2Sample() {
6767

6868
@Test
6969
@Order(4)
70-
@Tag(TestTag.PART_TWO)
70+
@Tag(TestTag.PART_2)
7171
@Tag(TestTag.INPUT)
72-
@DisplayName(TestDisplayName.PART_TWO_INPUT)
72+
@DisplayName(TestDisplayName.PART_2_INPUT)
7373
public void testSolvePart2Input() {
7474

7575
// Read input file

0 commit comments

Comments
 (0)