File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
main/kotlin/io/github/tobi/laa/spring/boot/embedded/redis
test/kotlin/io/github/tobi/laa/spring/boot/embedded/redis/server Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ internal inline fun <reified T : Annotation> findTestClassAnnotation(
1010 var clazz = testClass
1111 var annotation = findAnnotation(clazz, annotationType)
1212 while (annotation == null && searchEnclosingClass(clazz) && clazz.enclosingClass != null ) {
13- annotation = findAnnotation(clazz, annotationType)
1413 clazz = clazz.enclosingClass
14+ annotation = findAnnotation(clazz, annotationType)
1515 }
1616 return annotation
1717}
Original file line number Diff line number Diff line change 1+ package io.github.tobi.laa.spring.boot.embedded.redis.server
2+
3+ import io.github.tobi.laa.spring.boot.embedded.redis.IntegrationTest
4+ import io.github.tobi.laa.spring.boot.embedded.redis.RedisTests
5+ import org.junit.jupiter.api.DisplayName
6+ import org.junit.jupiter.api.Nested
7+ import org.junit.jupiter.api.Test
8+ import org.springframework.beans.factory.annotation.Autowired
9+
10+ @EmbeddedRedisServer
11+ @DisplayName(" Using @EmbeddedRedisServer on a top level class with nested classes should work fine" )
12+ class NestedClassesTest {
13+
14+ @Nested
15+ @IntegrationTest
16+ @DisplayName(" Nested class should work with embedded Redis server from top level class" )
17+ inner class InnerClass {
18+
19+ @Autowired
20+ private lateinit var given: RedisTests
21+
22+ @Test
23+ @DisplayName(" It should be possible to write to Redis and the data should be available afterwards" )
24+ fun givenRandomTestdata_writingToRedis_dataShouldBeAvailable () {
25+ given.randomTestdata()
26+ .whenRedis().isBeingWrittenTo()
27+ .then().redis().shouldContainTheTestdata()
28+ }
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments