Skip to content

Commit a6567c7

Browse files
committed
Disable Infinispan tests on Java 23
Infinispan 14 does not work on Java 23, an upgrade to 15 is required. This commit therefore disables those tests when running against a Java version higher than 22. Unfortunately, the version of JUnit that we use has no value for Java 23, so we have to use OTHER for that purpose.
1 parent 9817201 commit a6567c7

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -38,6 +38,8 @@
3838
import org.infinispan.jcache.embedded.JCachingProvider;
3939
import org.infinispan.spring.embedded.provider.SpringEmbeddedCacheManager;
4040
import org.junit.jupiter.api.Test;
41+
import org.junit.jupiter.api.condition.DisabledOnJre;
42+
import org.junit.jupiter.api.condition.JRE;
4143

4244
import org.springframework.beans.factory.BeanCreationException;
4345
import org.springframework.beans.factory.config.BeanPostProcessor;
@@ -567,6 +569,7 @@ void hazelcastAsJCacheWithExistingHazelcastInstance() {
567569
}
568570

569571
@Test
572+
@DisabledOnJre(value = JRE.OTHER, disabledReason = "Infinispan 14 does not work on Java 23")
570573
void infinispanCacheWithConfig() {
571574
this.contextRunner.withUserConfiguration(DefaultCacheConfiguration.class)
572575
.withPropertyValues("spring.cache.type=infinispan", "spring.cache.infinispan.config=infinispan.xml")
@@ -577,13 +580,15 @@ void infinispanCacheWithConfig() {
577580
}
578581

579582
@Test
583+
@DisabledOnJre(value = JRE.OTHER, disabledReason = "Infinispan 14 does not work on Java 23")
580584
void infinispanCacheWithCustomizers() {
581585
this.contextRunner.withUserConfiguration(DefaultCacheAndCustomizersConfiguration.class)
582586
.withPropertyValues("spring.cache.type=infinispan")
583587
.run(verifyCustomizers("allCacheManagerCustomizer", "infinispanCacheManagerCustomizer"));
584588
}
585589

586590
@Test
591+
@DisabledOnJre(value = JRE.OTHER, disabledReason = "Infinispan 14 does not work on Java 23")
587592
void infinispanCacheWithCaches() {
588593
this.contextRunner.withUserConfiguration(DefaultCacheConfiguration.class)
589594
.withPropertyValues("spring.cache.type=infinispan", "spring.cache.cacheNames[0]=foo",
@@ -593,6 +598,7 @@ void infinispanCacheWithCaches() {
593598
}
594599

595600
@Test
601+
@DisabledOnJre(value = JRE.OTHER, disabledReason = "Infinispan 14 does not work on Java 23")
596602
void infinispanCacheWithCachesAndCustomConfig() {
597603
this.contextRunner.withUserConfiguration(InfinispanCustomConfiguration.class)
598604
.withPropertyValues("spring.cache.type=infinispan", "spring.cache.cacheNames[0]=foo",
@@ -605,6 +611,7 @@ void infinispanCacheWithCachesAndCustomConfig() {
605611
}
606612

607613
@Test
614+
@DisabledOnJre(value = JRE.OTHER, disabledReason = "Infinispan 14 does not work on Java 23")
608615
void infinispanAsJCacheWithCaches() {
609616
String cachingProviderClassName = JCachingProvider.class.getName();
610617
this.contextRunner.withUserConfiguration(DefaultCacheConfiguration.class)
@@ -615,6 +622,7 @@ void infinispanAsJCacheWithCaches() {
615622
}
616623

617624
@Test
625+
@DisabledOnJre(value = JRE.OTHER, disabledReason = "Infinispan 14 does not work on Java 23")
618626
void infinispanAsJCacheWithConfig() {
619627
String cachingProviderClassName = JCachingProvider.class.getName();
620628
String configLocation = "infinispan.xml";

spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def testHazelcast = tasks.register("testHazelcast", Test) {
8686
}
8787

8888
def testInfinispan = tasks.register("testInfinispan", Test) {
89+
enabled = (toolchain.javaVersion == null || toolchain.javaVersion.asInt() < 23)
8990
description = "Runs the tests against Infinispan"
9091
classpath = sourceSets.test.runtimeClasspath + configurations.infinispan
9192
systemProperties = ["spring.cache.jcache.config" : "classpath:infinispan.xml"]

0 commit comments

Comments
 (0)