Added testcontainers

Added testcontainers so we can run the tests without starting the db, since it's dockerized.
This commit is contained in:
Nico Athanassiadis 2025-01-13 12:39:46 +01:00
parent d8de67c45d
commit 6871172d57
2 changed files with 18 additions and 1 deletions
pom.xml
src/test/java/se/su/dsv/seshat

15
pom.xml

@ -92,6 +92,21 @@
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-testcontainers</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>mariadb</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>

@ -2,10 +2,12 @@ package se.su.dsv.seshat;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
@SpringBootTest
class SeshatApplicationTests {
@ServiceConnection
private static org.testcontainers.containers.MariaDBContainer<?> dbContainer = new org.testcontainers.containers.MariaDBContainer<>("mariadb:10.11");
@Test
void contextLoads() {
}