Merge branch '2.6.x' into 2.7.x

pull/29525/head
Phillip Webb 3 years ago
commit e95c514fd5

@ -23,7 +23,6 @@ import java.util.List;
import java.util.function.Supplier; import java.util.function.Supplier;
import java.util.stream.Stream; import java.util.stream.Stream;
import org.junit.Assume;
import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource; import org.junit.jupiter.params.provider.MethodSource;
import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.GenericContainer;
@ -50,7 +49,6 @@ class LoaderIntegrationTests {
@ParameterizedTest @ParameterizedTest
@MethodSource("javaRuntimes") @MethodSource("javaRuntimes")
void readUrlsWithoutWarning(JavaRuntime javaRuntime) { void readUrlsWithoutWarning(JavaRuntime javaRuntime) {
javaRuntime.assumeCompatible();
try (GenericContainer<?> container = createContainer(javaRuntime)) { try (GenericContainer<?> container = createContainer(javaRuntime)) {
container.start(); container.start();
System.out.println(this.output.toUtf8String()); System.out.println(this.output.toUtf8String());
@ -79,7 +77,7 @@ class LoaderIntegrationTests {
javaRuntimes.add(JavaRuntime.openJdk(JavaVersion.ELEVEN)); javaRuntimes.add(JavaRuntime.openJdk(JavaVersion.ELEVEN));
javaRuntimes.add(JavaRuntime.openJdk(JavaVersion.SEVENTEEN)); javaRuntimes.add(JavaRuntime.openJdk(JavaVersion.SEVENTEEN));
javaRuntimes.add(JavaRuntime.oracleJdk17()); javaRuntimes.add(JavaRuntime.oracleJdk17());
return javaRuntimes.stream(); return javaRuntimes.stream().filter(JavaRuntime::isCompatible);
} }
static final class JavaRuntime { static final class JavaRuntime {
@ -96,8 +94,8 @@ class LoaderIntegrationTests {
this.container = container; this.container = container;
} }
private void assumeCompatible() { private boolean isCompatible() {
Assume.assumeTrue(JavaVersion.getJavaVersion().isEqualOrNewerThan(this.version)); return this.version.isEqualOrNewerThan(JavaVersion.getJavaVersion());
} }
GenericContainer<?> getContainer() { GenericContainer<?> getContainer() {

Loading…
Cancel
Save