1010
1111package org .junit .jupiter .engine .extension ;
1212
13- import static org .assertj .core .api .Assertions .allOf ;
1413import static org .assertj .core .api .Assertions .assertThat ;
1514import static org .junit .jupiter .api .Assertions .assertEquals ;
1615import static org .junit .jupiter .api .TestInstance .Lifecycle .PER_CLASS ;
@@ -75,10 +74,10 @@ void multipleFactoriesRegisteredOnSingleTestClass() {
7574 event (engine (), started ()), //
7675 event (container (testClass ), started ()), //
7776 event (container (testClass ),
78- finishedWithFailure (allOf ( instanceOf (ExtensionConfigurationException .class ),
77+ finishedWithFailure (instanceOf (ExtensionConfigurationException .class ),
7978 message ("The following TestInstanceFactory extensions were registered for test class ["
8079 + testClass .getName () + "], but only one is permitted: "
81- + nullSafeToString (FooInstanceFactory .class , BarInstanceFactory .class ))))) , //
80+ + nullSafeToString (FooInstanceFactory .class , BarInstanceFactory .class )))), //
8281 event (engine (), finishedSuccessfully ()));
8382 }
8483
@@ -94,10 +93,10 @@ void multipleFactoriesRegisteredWithinTestClassHierarchy() {
9493 event (engine (), started ()), //
9594 event (container (testClass ), started ()), //
9695 event (container (testClass ),
97- finishedWithFailure (allOf ( instanceOf (ExtensionConfigurationException .class ),
96+ finishedWithFailure (instanceOf (ExtensionConfigurationException .class ),
9897 message ("The following TestInstanceFactory extensions were registered for test class ["
9998 + testClass .getName () + "], but only one is permitted: "
100- + nullSafeToString (FooInstanceFactory .class , BarInstanceFactory .class ))))) , //
99+ + nullSafeToString (FooInstanceFactory .class , BarInstanceFactory .class )))), //
101100 event (engine (), finishedSuccessfully ()));
102101 }
103102
@@ -117,10 +116,10 @@ void multipleFactoriesRegisteredWithinNestedClassStructure() {
117116 event (test ("outerTest()" ), finishedSuccessfully ()), //
118117 event (nestedContainer (nestedClass ), started ()), //
119118 event (nestedContainer (nestedClass ),
120- finishedWithFailure (allOf ( instanceOf (ExtensionConfigurationException .class ),
119+ finishedWithFailure (instanceOf (ExtensionConfigurationException .class ),
121120 message ("The following TestInstanceFactory extensions were registered for test class ["
122121 + nestedClass .getName () + "], but only one is permitted: "
123- + nullSafeToString (FooInstanceFactory .class , BarInstanceFactory .class ))))) , //
122+ + nullSafeToString (FooInstanceFactory .class , BarInstanceFactory .class )))), //
124123 event (container (outerClass ), finishedSuccessfully ()), //
125124 event (engine (), finishedSuccessfully ()));
126125 }
@@ -138,10 +137,10 @@ void nullTestInstanceFactoryWithPerMethodLifecycle() {
138137 event (container (testClass ), started ()), //
139138 event (test ("testShouldNotBeCalled" ), started ()), //
140139 event (test ("testShouldNotBeCalled" ),
141- finishedWithFailure (allOf ( instanceOf (TestInstantiationException .class ),
140+ finishedWithFailure (instanceOf (TestInstantiationException .class ),
142141 message (m -> m .equals ("TestInstanceFactory [" + NullTestInstanceFactory .class .getName ()
143142 + "] failed to return an instance of [" + testClass .getName ()
144- + "] and instead returned an instance of [null]." ))))) , //
143+ + "] and instead returned an instance of [null]." )))), //
145144 event (container (testClass ), finishedSuccessfully ()), //
146145 event (engine (), finishedSuccessfully ()));
147146 }
@@ -158,10 +157,10 @@ void nullTestInstanceFactoryWithPerClassLifecycle() {
158157 event (engine (), started ()), //
159158 event (container (testClass ), started ()), //
160159 event (container (testClass ),
161- finishedWithFailure (allOf ( instanceOf (TestInstantiationException .class ),
160+ finishedWithFailure (instanceOf (TestInstantiationException .class ),
162161 message (m -> m .equals ("TestInstanceFactory [" + NullTestInstanceFactory .class .getName ()
163162 + "] failed to return an instance of [" + testClass .getName ()
164- + "] and instead returned an instance of [null]." ))))) , //
163+ + "] and instead returned an instance of [null]." )))), //
165164 event (engine (), finishedSuccessfully ()));
166165 }
167166
@@ -178,10 +177,10 @@ void bogusTestInstanceFactoryWithPerMethodLifecycle() {
178177 event (container (testClass ), started ()), //
179178 event (test ("testShouldNotBeCalled" ), started ()), //
180179 event (test ("testShouldNotBeCalled" ),
181- finishedWithFailure (allOf ( instanceOf (TestInstantiationException .class ),
180+ finishedWithFailure (instanceOf (TestInstantiationException .class ),
182181 message (m -> m .equals ("TestInstanceFactory [" + BogusTestInstanceFactory .class .getName ()
183182 + "] failed to return an instance of [" + testClass .getName ()
184- + "] and instead returned an instance of [java.lang.String]." ))))) , //
183+ + "] and instead returned an instance of [java.lang.String]." )))), //
185184 event (container (testClass ), finishedSuccessfully ()), //
186185 event (engine (), finishedSuccessfully ()));
187186 }
@@ -198,10 +197,10 @@ void bogusTestInstanceFactoryWithPerClassLifecycle() {
198197 event (engine (), started ()), //
199198 event (container (testClass ), started ()), //
200199 event (container (testClass ),
201- finishedWithFailure (allOf ( instanceOf (TestInstantiationException .class ),
200+ finishedWithFailure (instanceOf (TestInstantiationException .class ),
202201 message (m -> m .equals ("TestInstanceFactory [" + BogusTestInstanceFactory .class .getName ()
203202 + "] failed to return an instance of [" + testClass .getName ()
204- + "] and instead returned an instance of [java.lang.String]." ))))) , //
203+ + "] and instead returned an instance of [java.lang.String]." )))), //
205204 event (engine (), finishedSuccessfully ()));
206205 }
207206
@@ -218,9 +217,9 @@ void explosiveTestInstanceFactoryWithPerMethodLifecycle() {
218217 event (container (testClass ), started ()), //
219218 event (test ("testShouldNotBeCalled" ), started ()), //
220219 event (test ("testShouldNotBeCalled" ),
221- finishedWithFailure (allOf ( instanceOf (TestInstantiationException .class ),
220+ finishedWithFailure (instanceOf (TestInstantiationException .class ),
222221 message ("TestInstanceFactory [" + ExplosiveTestInstanceFactory .class .getName ()
223- + "] failed to instantiate test class [" + testClass .getName () + "]: boom!" )))) , //
222+ + "] failed to instantiate test class [" + testClass .getName () + "]: boom!" ))), //
224223 event (container (testClass ), finishedSuccessfully ()), //
225224 event (engine (), finishedSuccessfully ()));
226225 }
@@ -237,9 +236,9 @@ void explosiveTestInstanceFactoryWithPerClassLifecycle() {
237236 event (engine (), started ()), //
238237 event (container (testClass ), started ()), //
239238 event (container (testClass ), //
240- finishedWithFailure (allOf ( instanceOf (TestInstantiationException .class ),
239+ finishedWithFailure (instanceOf (TestInstantiationException .class ),
241240 message ("TestInstanceFactory [" + ExplosiveTestInstanceFactory .class .getName ()
242- + "] failed to instantiate test class [" + testClass .getName () + "]: boom!" )))) , //
241+ + "] failed to instantiate test class [" + testClass .getName () + "]: boom!" ))), //
243242 event (engine (), finishedSuccessfully ()));
244243 }
245244
@@ -259,12 +258,12 @@ void proxyTestInstanceFactoryFailsDueToUseOfDifferentClassLoader() {
259258 // instantiated using different ClassLoaders. Thus, we check for the
260259 // appended "@" but ignore the actual hash code for the test class
261260 // loaded by the different ClassLoader.
262- finishedWithFailure (allOf ( instanceOf (TestInstantiationException .class ),
261+ finishedWithFailure (instanceOf (TestInstantiationException .class ),
263262 message (m -> m .startsWith ("TestInstanceFactory [" + ProxyTestInstanceFactory .class .getName () + "]" )
264263 && m .contains ("failed to return an instance of [" + testClass .getName () + "@"
265264 + Integer .toHexString (System .identityHashCode (testClass )))
266265 && m .contains ("and instead returned an instance of [" + testClass .getName () + "@" )//
267- )))) , //
266+ ))), //
268267 event (engine (), finishedSuccessfully ()));
269268 }
270269
0 commit comments