All checks were successful
Quality Check / Validate OAS (push) Successful in 37s
Quality Check / Validate OAS (pull_request) Successful in 36s
Quality Check / Linting (push) Successful in 1m14s
Quality Check / Testing (push) Successful in 1m17s
Quality Check / Static Analysis (push) Successful in 1m22s
Quality Check / Linting (pull_request) Successful in 1m7s
Quality Check / Static Analysis (pull_request) Successful in 1m11s
Quality Check / Testing (pull_request) Successful in 45s
38 lines
1 KiB
Java
38 lines
1 KiB
Java
package de.towerdefence.server;
|
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import de.towerdefence.server.player.PlayerRepository;
|
|
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;
|
|
@Autowired
|
|
protected PlayerRepository playerRepository;
|
|
|
|
@BeforeEach
|
|
void setUp() {
|
|
playerRepository.deleteAll();
|
|
}
|
|
|
|
@AfterEach
|
|
void cleanUp() {
|
|
playerRepository.deleteAll();
|
|
}
|
|
|
|
}
|
|
|