Skip to content

Commit ef18e65

Browse files
#5261 : refactored the test class
1 parent 5724d9c commit ef18e65

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

platform-tests/src/test/java/org/junit/platform/launcher/core/LauncherPreconditionTests.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,26 +45,26 @@ void launcherRejectsNullRequests(String displayName, Supplier<Launcher> launcher
4545

4646
private static Stream<Arguments> launcherSuppliers() {
4747
return Stream.of(
48-
Arguments.of("session-per-request launcher",
49-
(Supplier<Launcher>) () -> LauncherFactoryForTestingPurposesOnly
50-
.createLauncher(new TestEngineStub())),
51-
Arguments.of("default launcher",
52-
(Supplier<Launcher>) () -> new DefaultLauncher(List.of(new TestEngineStub()), List.of(),
53-
new NamespacedHierarchicalStore<Namespace>(null, closeAutoCloseables()))),
54-
Arguments.of("delegating launcher", (Supplier<Launcher>) () -> new DelegatingLauncher(new NoOpLauncher())),
55-
Arguments.of("intercepting launcher",
56-
(Supplier<Launcher>) () -> new InterceptingLauncher(new NoOpLauncher(),
57-
new NoOpLauncherInterceptor())));
48+
Arguments.of("session-per-request launcher",
49+
(Supplier<Launcher>) () -> LauncherFactoryForTestingPurposesOnly.createLauncher(new TestEngineStub())),
50+
Arguments.of("default launcher",
51+
(Supplier<Launcher>) () -> new DefaultLauncher(List.of(new TestEngineStub()), List.of(),
52+
new NamespacedHierarchicalStore<Namespace>(null, closeAutoCloseables()))),
53+
Arguments.of("delegating launcher", (Supplier<Launcher>) () -> new DelegatingLauncher(new NoOpLauncher())),
54+
Arguments.of("intercepting launcher",
55+
(Supplier<Launcher>) () -> new InterceptingLauncher(new NoOpLauncher(),
56+
new NoOpLauncherInterceptor())));
5857
}
5958

6059
private static void assertRejectsNullRequests(Launcher launcher) {
6160
assertPreconditionViolationExactly(() -> launcher.discover(nullValue(LauncherDiscoveryRequest.class)),
62-
"LauncherDiscoveryRequest must not be null");
61+
"LauncherDiscoveryRequest must not be null");
6362
assertPreconditionViolationExactly(() -> launcher.execute(nullValue(LauncherDiscoveryRequest.class)),
64-
"LauncherDiscoveryRequest must not be null");
65-
assertPreconditionViolationExactly(() -> launcher.execute(nullValue(TestPlan.class)), "TestPlan must not be null");
63+
"LauncherDiscoveryRequest must not be null");
64+
assertPreconditionViolationExactly(() -> launcher.execute(nullValue(TestPlan.class)),
65+
"TestPlan must not be null");
6666
assertPreconditionViolationExactly(() -> launcher.execute(nullValue(LauncherExecutionRequest.class)),
67-
"LauncherExecutionRequest must not be null");
67+
"LauncherExecutionRequest must not be null");
6868
}
6969

7070
private static void assertPreconditionViolationExactly(Runnable action, String expectedMessage) {
@@ -124,4 +124,4 @@ public <T> T intercept(Invocation<T> invocation) {
124124
public void close() {
125125
}
126126
}
127-
}
127+
}

0 commit comments

Comments
 (0)