diff --git a/keiko-mem-spring/keiko-mem-spring.gradle b/keiko-mem-spring/keiko-mem-spring.gradle index 9486a12ab0..32e9f89cbb 100644 --- a/keiko-mem-spring/keiko-mem-spring.gradle +++ b/keiko-mem-spring/keiko-mem-spring.gradle @@ -15,6 +15,6 @@ dependencies { test { useJUnitPlatform { - includeEngines "jupiter" + includeEngines "junit-jupiter" } } diff --git a/keiko-mem-spring/src/test/kotlin/com/netflix/spinnaker/q/mem/spring/SpringStartupTests.kt b/keiko-mem-spring/src/test/kotlin/com/netflix/spinnaker/q/mem/spring/SpringStartupTests.kt index c4c0c7cb2f..48d6ff8993 100644 --- a/keiko-mem-spring/src/test/kotlin/com/netflix/spinnaker/q/mem/spring/SpringStartupTests.kt +++ b/keiko-mem-spring/src/test/kotlin/com/netflix/spinnaker/q/mem/spring/SpringStartupTests.kt @@ -1,5 +1,6 @@ package com.netflix.spinnaker.q.mem.spring +import com.netflix.spectator.api.NoopRegistry import com.netflix.spinnaker.config.MemQueueConfiguration import com.netflix.spinnaker.config.QueueConfiguration import com.netflix.spinnaker.q.DeadMessageCallback @@ -13,6 +14,7 @@ import org.springframework.boot.test.context.SpringBootTest import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration import org.springframework.test.context.junit.jupiter.SpringExtension +import com.netflix.spectator.api.Registry @ExtendWith(SpringExtension::class) @SpringBootTest( @@ -34,4 +36,7 @@ internal class SpringStartupTests { internal class TestConfiguration { @Bean fun deadMessageCallback(): DeadMessageCallback = { _, _ -> } + + @Bean + fun registry(): Registry = NoopRegistry() } diff --git a/keiko-redis-spring/keiko-redis-spring.gradle b/keiko-redis-spring/keiko-redis-spring.gradle index 497cc60619..5394afca05 100644 --- a/keiko-redis-spring/keiko-redis-spring.gradle +++ b/keiko-redis-spring/keiko-redis-spring.gradle @@ -9,12 +9,13 @@ dependencies { testImplementation "org.springframework:spring-test" testImplementation "org.springframework.boot:spring-boot-test" testImplementation "org.assertj:assertj-core" + testImplementation("io.spinnaker.kork:kork-jedis-test") testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine" } test { useJUnitPlatform { - includeEngines "jupiter" + includeEngines "junit-jupiter" } } diff --git a/keiko-redis-spring/src/test/kotlin/com/netflix/spinnaker/q/redis/spring/SpringStartupTests.kt b/keiko-redis-spring/src/test/kotlin/com/netflix/spinnaker/q/redis/spring/SpringStartupTests.kt index 5aea149ee2..400a5a6382 100644 --- a/keiko-redis-spring/src/test/kotlin/com/netflix/spinnaker/q/redis/spring/SpringStartupTests.kt +++ b/keiko-redis-spring/src/test/kotlin/com/netflix/spinnaker/q/redis/spring/SpringStartupTests.kt @@ -1,5 +1,7 @@ package com.netflix.spinnaker.q.redis.spring +import com.netflix.spectator.api.NoopRegistry +import com.netflix.spectator.api.Registry import com.netflix.spinnaker.config.QueueConfiguration import com.netflix.spinnaker.config.RedisQueueConfiguration import com.netflix.spinnaker.q.Queue @@ -10,11 +12,15 @@ import org.junit.jupiter.api.extension.ExtendWith import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.context.SpringBootTest import org.springframework.boot.test.context.SpringBootTest.WebEnvironment.NONE +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.Configuration import org.springframework.test.context.junit.jupiter.SpringExtension +import com.netflix.spinnaker.kork.jedis.EmbeddedRedis +import redis.clients.jedis.JedisPool @ExtendWith(SpringExtension::class) @SpringBootTest( - classes = [QueueConfiguration::class, RedisQueueConfiguration::class], + classes = [QueueConfiguration::class, RedisQueueConfiguration::class, TestConfiguration::class], webEnvironment = NONE ) internal class SpringStartupTests { @@ -27,3 +33,11 @@ internal class SpringStartupTests { Assertions.assertThat(queue).isNotNull.isInstanceOf(RedisQueue::class.java) } } +@Configuration +internal class TestConfiguration { + @Bean + fun registry(): Registry = NoopRegistry() + + @Bean + fun queueRedisPool(): JedisPool = EmbeddedRedis.embed().pool +}