Skip to content

Commit 7f3d39d

Browse files
Enable Tests using VirtualThreads for java 21 onwards.
This commit updates tests using virtual threads to run for java versions 21+. See: #665
1 parent 3953888 commit 7f3d39d

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

jpa/example/src/test/java/example/springdata/jpa/simple/VirtualThreadsTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
import org.junit.jupiter.api.BeforeEach;
2727
import org.junit.jupiter.api.Test;
28-
import org.junit.jupiter.api.condition.EnabledOnJre;
28+
import org.junit.jupiter.api.condition.EnabledForJreRange;
2929
import org.junit.jupiter.api.condition.JRE;
3030

3131
import org.springframework.beans.factory.annotation.Autowired;
@@ -41,7 +41,7 @@
4141
*/
4242
@Transactional
4343
@SpringBootTest(properties = "spring.threads.virtual.enabled=true")
44-
@EnabledOnJre(JRE.JAVA_21)
44+
@EnabledForJreRange(min = JRE.JAVA_21)
4545
class VirtualThreadsTests {
4646

4747
@Autowired SimpleUserRepository repository;

redis/pubsub/src/test/java/example/springdata/redis/PubSubVirtualThreadsTests.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222
import java.util.concurrent.TimeUnit;
2323

2424
import org.junit.jupiter.api.Test;
25-
import org.junit.jupiter.api.condition.EnabledOnJre;
25+
import org.junit.jupiter.api.condition.EnabledForJreRange;
2626
import org.junit.jupiter.api.condition.JRE;
27-
2827
import org.springframework.beans.factory.annotation.Autowired;
2928
import org.springframework.boot.test.context.SpringBootTest;
3029
import org.springframework.core.task.AsyncTaskExecutor;
@@ -39,7 +38,7 @@
3938
* @author Mark Paluch
4039
*/
4140
@SpringBootTest(properties = "spring.threads.virtual.enabled=true")
42-
@EnabledOnJre(JRE.JAVA_21)
41+
@EnabledForJreRange(min = JRE.JAVA_21)
4342
public class PubSubVirtualThreadsTests {
4443

4544
@Autowired RedisConnectionFactory connectionFactory;

0 commit comments

Comments
 (0)