2025-02-01 14:18:34 +01:00
|
|
|
package de.towerdefence.server;
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
2025-02-11 14:16:35 +01:00
|
|
|
import de.towerdefence.server.player.PlayerRepository;
|
|
|
|
import de.towerdefence.server.player.PlayerService;
|
2025-02-01 14:18:34 +01:00
|
|
|
import org.junit.jupiter.api.AfterEach;
|
|
|
|
import org.junit.jupiter.api.BeforeEach;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
|
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
import org.springframework.test.context.ActiveProfiles;
|
|
|
|
import org.springframework.test.web.servlet.MockMvc;
|
|
|
|
|
|
|
|
@SpringBootTest
|
|
|
|
@AutoConfigureMockMvc(addFilters = false)
|
|
|
|
@ActiveProfiles("test")
|
|
|
|
public abstract class IntegrationTest {
|
|
|
|
|
|
|
|
protected final static String baseUri = "/api/v1";
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
protected MockMvc mvc;
|
|
|
|
@Autowired
|
|
|
|
protected ObjectMapper objectMapper;
|
2025-02-11 14:16:35 +01:00
|
|
|
@Autowired
|
|
|
|
protected PlayerRepository playerRepository;
|
2025-02-01 14:18:34 +01:00
|
|
|
|
|
|
|
@BeforeEach
|
|
|
|
void setUp() {
|
2025-02-11 14:16:35 +01:00
|
|
|
playerRepository.deleteAll();
|
2025-02-01 14:18:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@AfterEach
|
|
|
|
void cleanUp() {
|
2025-02-11 14:16:35 +01:00
|
|
|
playerRepository.deleteAll();
|
2025-02-01 14:18:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|