From ccb0b2910f049f262850944fb88a037c175cd66f Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Wed, 26 Jun 2024 10:46:18 +0100 Subject: [PATCH] Update spring-boot-smoke-test-cache to use docker-test plugin See gh-41228 --- .../spring-boot-smoke-test-cache/build.gradle | 36 ++++++++----------- .../SampleCacheApplicationRedisTests.java | 0 .../resources/logback-test.xml | 0 3 files changed, 15 insertions(+), 21 deletions(-) rename spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/src/{redisTest => dockerTest}/java/smoketest/cache/SampleCacheApplicationRedisTests.java (100%) rename spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/src/{redisTest => dockerTest}/resources/logback-test.xml (100%) diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/build.gradle index d9137303b31..73d5790ff46 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/build.gradle +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/build.gradle @@ -1,6 +1,7 @@ plugins { id "java" id "org.springframework.boot.conventions" + id "org.springframework.boot.docker-test" } description = "Spring Boot cache smoke test" @@ -21,18 +22,18 @@ configurations { } dependencies { - implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-actuator")) - implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-cache")) - implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web")) - - testImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test")) - caffeine(enforcedPlatform(project(":spring-boot-project:spring-boot-dependencies"))) caffeine("com.github.ben-manes.caffeine:caffeine") couchbase(enforcedPlatform(project(":spring-boot-project:spring-boot-dependencies"))) couchbase(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-data-couchbase")) - + + dockerTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-data-redis")) + dockerTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test")) + dockerTestImplementation(project(":spring-boot-project:spring-boot-testcontainers")) + dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) + dockerTestImplementation("org.testcontainers:junit-jupiter") + ehcache(enforcedPlatform(project(":spring-boot-project:spring-boot-dependencies"))) ehcache("javax.cache:cache-api") ehcache("org.ehcache:ehcache::jakarta") @@ -40,6 +41,10 @@ dependencies { hazelcast(enforcedPlatform(project(":spring-boot-project:spring-boot-dependencies"))) hazelcast("com.hazelcast:hazelcast") hazelcast("com.hazelcast:hazelcast-spring") + + implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-actuator")) + implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-cache")) + implementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-web")) infinispan(enforcedPlatform(project(":spring-boot-project:spring-boot-dependencies"))) infinispan("javax.cache:cache-api") @@ -55,13 +60,8 @@ dependencies { replacedBy("org.infinispan:infinispan-core-jakarta", "Java EE 9 baseline") } } - - redisTestImplementation(enforcedPlatform(project(":spring-boot-project:spring-boot-parent"))) - redisTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-data-redis")) - redisTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test")) - redisTestImplementation(project(":spring-boot-project:spring-boot-testcontainers")) - redisTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support")) - redisTestImplementation("org.testcontainers:junit-jupiter") + + testImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test")) } def testCaffeine = tasks.register("testCaffeine", Test) { @@ -91,12 +91,6 @@ def testInfinispan = tasks.register("testInfinispan", Test) { systemProperties = ["spring.cache.jcache.config" : "classpath:infinispan.xml"] } -def testRedis = tasks.register("testRedis", Test) { - description = "Runs the tests against Redis" - classpath = sourceSets.redisTest.runtimeClasspath - testClassesDirs = sourceSets.redisTest.output.classesDirs -} - tasks.named("check").configure { - dependsOn testCaffeine, testCouchbase, testEhcache, testHazelcast, testInfinispan, testRedis + dependsOn testCaffeine, testCouchbase, testEhcache, testHazelcast, testInfinispan } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/src/redisTest/java/smoketest/cache/SampleCacheApplicationRedisTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/src/dockerTest/java/smoketest/cache/SampleCacheApplicationRedisTests.java similarity index 100% rename from spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/src/redisTest/java/smoketest/cache/SampleCacheApplicationRedisTests.java rename to spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/src/dockerTest/java/smoketest/cache/SampleCacheApplicationRedisTests.java diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/src/redisTest/resources/logback-test.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/src/dockerTest/resources/logback-test.xml similarity index 100% rename from spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/src/redisTest/resources/logback-test.xml rename to spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/src/dockerTest/resources/logback-test.xml