From 18adf905a8eb33bfaaaa42d4d6d078027f8090ea Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Thu, 23 Mar 2023 17:01:07 +0100 Subject: [PATCH] Polishing --- gradle/toolchains.gradle | 10 +++++----- .../core/SpringCoreBlockHoundIntegrationTests.java | 6 +++--- ...pplicationManagedEntityManagerIntegrationTests.java | 4 ++-- .../ContainerManagedEntityManagerIntegrationTests.java | 4 ++-- ...clipseLinkEntityManagerFactoryIntegrationTests.java | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/gradle/toolchains.gradle b/gradle/toolchains.gradle index 88ce8032689..176ac545d5f 100644 --- a/gradle/toolchains.gradle +++ b/gradle/toolchains.gradle @@ -5,10 +5,10 @@ * One can choose the toolchain to use for compiling the MAIN sources and/or compiling * and running the TEST sources. These options apply to Java, Kotlin and Groovy sources * when available. - * {@code "./gradlew check -PmainToolchain=17 -PtestToolchain=19"} will use: + * {@code "./gradlew check -PmainToolchain=17 -PtestToolchain=20"} will use: * * * By default, the build will fall back to using the current JDK and 17 language level for all sourceSets. @@ -23,9 +23,9 @@ * {@code * $ echo JDK17 * /opt/openjdk/java17 - * $ echo JDK19 - * /opt/openjdk/java18 - * $ ./gradlew -Porg.gradle.java.installations.fromEnv=JDK17,JDK19 check + * $ echo JDK20 + * /opt/openjdk/java20 + * $ ./gradlew -Porg.gradle.java.installations.fromEnv=JDK17,JDK20 check * } * * @author Brian Clozel diff --git a/spring-core/src/test/java/org/springframework/core/SpringCoreBlockHoundIntegrationTests.java b/spring-core/src/test/java/org/springframework/core/SpringCoreBlockHoundIntegrationTests.java index 55dea7b11ea..a6872f168ba 100644 --- a/spring-core/src/test/java/org/springframework/core/SpringCoreBlockHoundIntegrationTests.java +++ b/spring-core/src/test/java/org/springframework/core/SpringCoreBlockHoundIntegrationTests.java @@ -21,8 +21,7 @@ import java.util.concurrent.CompletableFuture; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledOnJre; -import org.junit.jupiter.api.condition.JRE; +import org.junit.jupiter.api.condition.DisabledForJreRange; import reactor.blockhound.BlockHound; import reactor.core.scheduler.ReactorBlockHoundIntegration; import reactor.core.scheduler.Schedulers; @@ -31,6 +30,7 @@ import org.springframework.util.ConcurrentReferenceHashMap; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.junit.jupiter.api.condition.JRE.JAVA_18; /** * Tests to verify the spring-core BlockHound integration rules. @@ -47,7 +47,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; * @author Sam Brannen * @since 5.2.4 */ -@DisabledOnJre(value= {JRE.JAVA_18, JRE.JAVA_19, JRE.JAVA_20}, disabledReason = "BlockHound is not compatible with Java 18+") +@DisabledForJreRange(min = JAVA_18, disabledReason = "BlockHound is not compatible with Java 18+") class SpringCoreBlockHoundIntegrationTests { @BeforeAll diff --git a/spring-orm/src/test/java/org/springframework/orm/jpa/ApplicationManagedEntityManagerIntegrationTests.java b/spring-orm/src/test/java/org/springframework/orm/jpa/ApplicationManagedEntityManagerIntegrationTests.java index 76933a62fac..3f8b9ad45c4 100644 --- a/spring-orm/src/test/java/org/springframework/orm/jpa/ApplicationManagedEntityManagerIntegrationTests.java +++ b/spring-orm/src/test/java/org/springframework/orm/jpa/ApplicationManagedEntityManagerIntegrationTests.java @@ -24,12 +24,12 @@ import jakarta.persistence.Query; import jakarta.persistence.TransactionRequiredException; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledOnJre; -import org.junit.jupiter.api.condition.JRE; import org.springframework.orm.jpa.domain.Person; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; +import static org.junit.jupiter.api.condition.JRE.JAVA_18; /** * An application-managed entity manager can join an existing transaction, @@ -39,7 +39,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType; * @author Juergen Hoeller * @since 2.0 */ -@DisabledOnJre(value = JRE.JAVA_18) +@DisabledOnJre(JAVA_18) public class ApplicationManagedEntityManagerIntegrationTests extends AbstractEntityManagerFactoryIntegrationTests { @Test diff --git a/spring-orm/src/test/java/org/springframework/orm/jpa/ContainerManagedEntityManagerIntegrationTests.java b/spring-orm/src/test/java/org/springframework/orm/jpa/ContainerManagedEntityManagerIntegrationTests.java index 1beff7a3b25..37df753581c 100644 --- a/spring-orm/src/test/java/org/springframework/orm/jpa/ContainerManagedEntityManagerIntegrationTests.java +++ b/spring-orm/src/test/java/org/springframework/orm/jpa/ContainerManagedEntityManagerIntegrationTests.java @@ -25,7 +25,6 @@ import jakarta.persistence.Query; import jakarta.persistence.TransactionRequiredException; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledOnJre; -import org.junit.jupiter.api.condition.JRE; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DataAccessException; @@ -35,6 +34,7 @@ import org.springframework.orm.jpa.domain.Person; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.assertj.core.api.Assertions.assertThatIllegalStateException; +import static org.junit.jupiter.api.condition.JRE.JAVA_18; /** * Integration tests using in-memory database for container-managed JPA @@ -43,7 +43,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException; * @author Juergen Hoeller * @since 2.0 */ -@DisabledOnJre(value = JRE.JAVA_18) +@DisabledOnJre(JAVA_18) public class ContainerManagedEntityManagerIntegrationTests extends AbstractEntityManagerFactoryIntegrationTests { @Autowired diff --git a/spring-orm/src/test/java/org/springframework/orm/jpa/eclipselink/EclipseLinkEntityManagerFactoryIntegrationTests.java b/spring-orm/src/test/java/org/springframework/orm/jpa/eclipselink/EclipseLinkEntityManagerFactoryIntegrationTests.java index 5f346f51929..2cb89213941 100644 --- a/spring-orm/src/test/java/org/springframework/orm/jpa/eclipselink/EclipseLinkEntityManagerFactoryIntegrationTests.java +++ b/spring-orm/src/test/java/org/springframework/orm/jpa/eclipselink/EclipseLinkEntityManagerFactoryIntegrationTests.java @@ -19,19 +19,19 @@ package org.springframework.orm.jpa.eclipselink; import org.eclipse.persistence.jpa.JpaEntityManager; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.DisabledOnJre; -import org.junit.jupiter.api.condition.JRE; import org.springframework.orm.jpa.AbstractContainerEntityManagerFactoryIntegrationTests; import org.springframework.orm.jpa.EntityManagerFactoryInfo; import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.condition.JRE.JAVA_18; /** * EclipseLink-specific JPA tests. * * @author Juergen Hoeller */ -@DisabledOnJre(value = JRE.JAVA_18) +@DisabledOnJre(JAVA_18) public class EclipseLinkEntityManagerFactoryIntegrationTests extends AbstractContainerEntityManagerFactoryIntegrationTests { @Test