Skip to content

Commit

Permalink
@testcontainers annotation moved to TestContainersConfiguration,
Browse files Browse the repository at this point in the history
  • Loading branch information
igorakkerman committed Apr 17, 2021
1 parent 1112011 commit bcc2759
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
Expand Up @@ -13,14 +13,12 @@ import org.springframework.kafka.core.ConsumerFactory
import org.springframework.kafka.test.utils.KafkaTestUtils
import org.springframework.test.annotation.DirtiesContext
import org.springframework.test.context.junit.jupiter.EnabledIf
import org.testcontainers.junit.jupiter.Testcontainers
import java.time.LocalDateTime

@SpringBootTest(classes = [KafkaMoveNotifier::class])
@EnabledIf(expression = "\${test.container.enabled:false}", loadContext = true)
@EnableAutoConfiguration
@Import(TestContainersConfiguration::class)
@Testcontainers
@DirtiesContext
internal class ContainerKafkaMoveNotifierTest(
@Autowired
Expand Down
Expand Up @@ -15,14 +15,12 @@ import org.springframework.context.annotation.Import
import org.springframework.kafka.core.ProducerFactory
import org.springframework.test.annotation.DirtiesContext
import org.springframework.test.context.junit.jupiter.EnabledIf
import org.testcontainers.junit.jupiter.Testcontainers
import java.time.LocalDateTime

@SpringBootTest(classes = [KafkaMoveReceiver::class])
@EnabledIf(expression = "\${test.container.enabled:false}", loadContext = true)
@EnableAutoConfiguration
@Import(TestContainersConfiguration::class)
@Testcontainers
@DirtiesContext
internal class ContainerKafkaMoveReceiverTest(
@Autowired
Expand Down
Expand Up @@ -14,10 +14,12 @@ import org.springframework.kafka.core.DefaultKafkaProducerFactory
import org.springframework.kafka.core.ProducerFactory
import org.testcontainers.containers.KafkaContainer
import org.testcontainers.junit.jupiter.Container
import org.testcontainers.junit.jupiter.Testcontainers
import org.testcontainers.utility.DockerImageName

@TestConfiguration
@ConditionalOnProperty("test.container.enabled", havingValue = "true")
@Testcontainers
internal class TestContainersConfiguration {

@Container
Expand Down

0 comments on commit bcc2759

Please sign in to comment.