<type>pom</type>
<scope>import</scope>
</dependency>
+ <dependency>
+ <groupId>org.testcontainers</groupId>
+ <artifactId>testcontainers-bom</artifactId>
+ <version>1.15.3</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
</dependencies>
</dependencyManagement>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
- <artifactId>junit-jupiter</artifactId>
- <version>1.15.2</version>
+ <artifactId>spock</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
- <version>1.15.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>kafka</artifactId>
- <version>1.15.3</version>
<scope>test</scope>
</dependency>
<dependency>
<pluginManagement>
<plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>3.0.0-M5</version>
+ </plugin>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
import org.springframework.test.context.DynamicPropertyRegistry
import org.springframework.test.context.DynamicPropertySource
import org.testcontainers.containers.KafkaContainer
+import org.testcontainers.spock.Testcontainers
import spock.lang.Shared
import spock.lang.Specification
import spock.util.concurrent.PollingConditions
* This integration test is running database and kafka dependencies as docker containers.
*/
@SpringBootTest
+@Testcontainers
@Slf4j
class DataUpdatedEventListenerIntegrationSpec extends Specification {
@Shared
- def databaseTestContainer = TimescaleContainer.getInstance()
+ TimescaleContainer databaseTestContainer = TimescaleContainer.getInstance()
static kafkaTestContainer = new KafkaContainer()
static {
Runtime.getRuntime().addShutdownHook(new Thread(kafkaTestContainer::stop))
}
-
def setupSpec() {
- databaseTestContainer.start()
kafkaTestContainer.start()
}
import org.onap.cps.temporal.repository.containers.TimescaleContainer
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
-import org.testcontainers.junit.jupiter.Testcontainers
+import org.testcontainers.spock.Testcontainers
import spock.lang.Shared
import spock.lang.Specification
.schemaSet(schemaSetName).anchor(anchorName).payload(payload).build()
@Shared
- def databaseTestContainer = TimescaleContainer.getInstance()
-
- def setupSpec() {
- databaseTestContainer.start()
- }
+ TimescaleContainer databaseTestContainer = TimescaleContainer.getInstance()
def 'Store latest network data in timeseries database.'() {
when: 'a new Network Data is stored'