This commit is contained in:
Lee 2024-04-18 14:26:25 +01:00
parent 04b99715c1
commit f037f3f9e7
3 changed files with 12 additions and 3 deletions

@ -4,6 +4,7 @@ import cc.fascinated.config.TestRedisConfig;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.data.mongo.DataMongoTest;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
@ -15,7 +16,9 @@ import static org.springframework.test.web.servlet.request.MockMvcRequestBuilder
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@AutoConfigureMockMvc @AutoConfigureMockMvc
@SpringBootTest(classes = {TestRedisConfig.class, TestMongoConfig.class}) @SpringBootTest(classes = {TestRedisConfig.class})
@DataMongoTest()
@ExtendWith(SpringExtension.class)
class MojangControllerTests { class MojangControllerTests {
@Autowired @Autowired

@ -4,6 +4,7 @@ import cc.fascinated.config.TestRedisConfig;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.data.mongo.DataMongoTest;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
@ -17,7 +18,9 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@AutoConfigureMockMvc @AutoConfigureMockMvc
@SpringBootTest(classes = {TestRedisConfig.class, TestMongoConfig.class}) @SpringBootTest(classes = {TestRedisConfig.class})
@DataMongoTest()
@ExtendWith(SpringExtension.class)
class PlayerControllerTests { class PlayerControllerTests {
private final String testPlayerUuid = "eeab5f8a-18dd-4d58-af78-2b3c4543da48"; private final String testPlayerUuid = "eeab5f8a-18dd-4d58-af78-2b3c4543da48";

@ -4,6 +4,7 @@ import cc.fascinated.config.TestRedisConfig;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.data.mongo.DataMongoTest;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
@ -16,7 +17,9 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@AutoConfigureMockMvc @AutoConfigureMockMvc
@SpringBootTest(classes = {TestRedisConfig.class, TestMongoConfig.class}) @SpringBootTest(classes = {TestRedisConfig.class})
@DataMongoTest()
@ExtendWith(SpringExtension.class)
class ServerControllerTests { class ServerControllerTests {
private final String testServer = "play.hypixel.net"; private final String testServer = "play.hypixel.net";