Use new features from JUnit Jupiter 5.11
This commit primarily migrates to the new argumentSet() feature but also applies additional polishing to our use of parameterized tests. See gh-33395
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -26,10 +26,10 @@ import java.util.stream.Stream;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.Named;
|
||||
import org.junit.jupiter.api.extension.RegisterExtension;
|
||||
import org.junit.jupiter.api.extension.TestExecutionExceptionHandler;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
@@ -37,7 +37,7 @@ import org.springframework.http.server.reactive.HttpHandler;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.client.HttpServerErrorException;
|
||||
|
||||
import static org.junit.jupiter.api.Named.named;
|
||||
import static org.junit.jupiter.params.provider.Arguments.argumentSet;
|
||||
|
||||
public abstract class AbstractHttpHandlerIntegrationTests {
|
||||
|
||||
@@ -117,19 +117,19 @@ public abstract class AbstractHttpHandlerIntegrationTests {
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
@ParameterizedTest(name = "[{index}] {0}")
|
||||
@ParameterizedTest
|
||||
@MethodSource("org.springframework.web.testfixture.http.server.reactive.bootstrap.AbstractHttpHandlerIntegrationTests#httpServers()")
|
||||
// public for Kotlin
|
||||
public @interface ParameterizedHttpServerTest {
|
||||
}
|
||||
|
||||
static Stream<Named<HttpServer>> httpServers() {
|
||||
static Stream<Arguments> httpServers() {
|
||||
return Stream.of(
|
||||
named("Jetty", new JettyHttpServer()),
|
||||
named("Jetty Core", new JettyCoreHttpServer()),
|
||||
named("Reactor Netty", new ReactorHttpServer()),
|
||||
named("Tomcat", new TomcatHttpServer()),
|
||||
named("Undertow", new UndertowHttpServer())
|
||||
argumentSet("Jetty", new JettyHttpServer()),
|
||||
argumentSet("Jetty Core", new JettyCoreHttpServer()),
|
||||
argumentSet("Reactor Netty", new ReactorHttpServer()),
|
||||
argumentSet("Tomcat", new TomcatHttpServer()),
|
||||
argumentSet("Undertow", new UndertowHttpServer())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user