34
34
class InvalidLifecycleMethodConfigurationTests extends AbstractJupiterTestEngineTests {
35
35
36
36
@ Test
37
- void executeValidTestCaseAlongsideTestCaseWithInvalidBeforeAllDeclaration () {
38
- assertExecutionResults (TestCaseWithInvalidBeforeAllMethod .class );
37
+ void executeValidTestCaseAlongsideTestCaseWithInvalidNonStaticBeforeAllDeclaration () {
38
+ assertExecutionResults (TestCaseWithInvalidNonStaticBeforeAllMethod .class );
39
39
}
40
40
41
41
@ Test
42
- void executeValidTestCaseAlongsideTestCaseWithInvalidAfterAllDeclaration () {
43
- assertExecutionResults (TestCaseWithInvalidAfterAllMethod .class );
42
+ void executeValidTestCaseAlongsideTestCaseWithInvalidPrivateBeforeAllDeclaration () {
43
+ assertExecutionResults (TestCaseWithInvalidPrivateBeforeAllMethod .class );
44
+ }
45
+
46
+ @ Test
47
+ void executeValidTestCaseAlongsideTestCaseWithInvalidNonStaticAfterAllDeclaration () {
48
+ assertExecutionResults (TestCaseWithInvalidNonStaticAfterAllMethod .class );
49
+ }
50
+
51
+ @ Test
52
+ void executeValidTestCaseAlongsideTestCaseWithInvalidPrivateAfterAllDeclaration () {
53
+ assertExecutionResults (TestCaseWithInvalidPrivateAfterAllMethod .class );
44
54
}
45
55
46
56
@ Test
@@ -90,7 +100,7 @@ void test() {
90
100
}
91
101
}
92
102
93
- static class TestCaseWithInvalidBeforeAllMethod {
103
+ static class TestCaseWithInvalidNonStaticBeforeAllMethod {
94
104
95
105
// must be static
96
106
@ BeforeAll
@@ -102,7 +112,19 @@ void test() {
102
112
}
103
113
}
104
114
105
- static class TestCaseWithInvalidAfterAllMethod {
115
+ static class TestCaseWithInvalidPrivateBeforeAllMethod {
116
+
117
+ // must not be private
118
+ @ BeforeAll
119
+ private static void beforeAll () {
120
+ }
121
+
122
+ @ Test
123
+ void test () {
124
+ }
125
+ }
126
+
127
+ static class TestCaseWithInvalidNonStaticAfterAllMethod {
106
128
107
129
// must be static
108
130
@ AfterAll
@@ -114,6 +136,18 @@ void test() {
114
136
}
115
137
}
116
138
139
+ static class TestCaseWithInvalidPrivateAfterAllMethod {
140
+
141
+ // must not be private
142
+ @ AfterAll
143
+ private static void afterAll () {
144
+ }
145
+
146
+ @ Test
147
+ void test () {
148
+ }
149
+ }
150
+
117
151
static class TestCaseWithInvalidStaticBeforeEachMethod {
118
152
119
153
// must NOT be static
0 commit comments