From f037f3f9e7cb186677c8907c3b8e52710b73bc04 Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 18 Apr 2024 14:26:25 +0100 Subject: [PATCH] pls work --- .../xyz/mcutils/backend/tests/MojangControllerTests.java | 5 ++++- .../xyz/mcutils/backend/tests/PlayerControllerTests.java | 5 ++++- .../xyz/mcutils/backend/tests/ServerControllerTests.java | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/test/java/xyz/mcutils/backend/tests/MojangControllerTests.java b/src/test/java/xyz/mcutils/backend/tests/MojangControllerTests.java index e4d2960..b5780e0 100644 --- a/src/test/java/xyz/mcutils/backend/tests/MojangControllerTests.java +++ b/src/test/java/xyz/mcutils/backend/tests/MojangControllerTests.java @@ -4,6 +4,7 @@ import cc.fascinated.config.TestRedisConfig; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; 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.context.SpringBootTest; 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; @AutoConfigureMockMvc -@SpringBootTest(classes = {TestRedisConfig.class, TestMongoConfig.class}) +@SpringBootTest(classes = {TestRedisConfig.class}) +@DataMongoTest() +@ExtendWith(SpringExtension.class) class MojangControllerTests { @Autowired diff --git a/src/test/java/xyz/mcutils/backend/tests/PlayerControllerTests.java b/src/test/java/xyz/mcutils/backend/tests/PlayerControllerTests.java index 887dbd8..3aacc98 100644 --- a/src/test/java/xyz/mcutils/backend/tests/PlayerControllerTests.java +++ b/src/test/java/xyz/mcutils/backend/tests/PlayerControllerTests.java @@ -4,6 +4,7 @@ import cc.fascinated.config.TestRedisConfig; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; 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.context.SpringBootTest; 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; @AutoConfigureMockMvc -@SpringBootTest(classes = {TestRedisConfig.class, TestMongoConfig.class}) +@SpringBootTest(classes = {TestRedisConfig.class}) +@DataMongoTest() +@ExtendWith(SpringExtension.class) class PlayerControllerTests { private final String testPlayerUuid = "eeab5f8a-18dd-4d58-af78-2b3c4543da48"; diff --git a/src/test/java/xyz/mcutils/backend/tests/ServerControllerTests.java b/src/test/java/xyz/mcutils/backend/tests/ServerControllerTests.java index a0db06e..977f202 100644 --- a/src/test/java/xyz/mcutils/backend/tests/ServerControllerTests.java +++ b/src/test/java/xyz/mcutils/backend/tests/ServerControllerTests.java @@ -4,6 +4,7 @@ import cc.fascinated.config.TestRedisConfig; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; 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.context.SpringBootTest; 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; @AutoConfigureMockMvc -@SpringBootTest(classes = {TestRedisConfig.class, TestMongoConfig.class}) +@SpringBootTest(classes = {TestRedisConfig.class}) +@DataMongoTest() +@ExtendWith(SpringExtension.class) class ServerControllerTests { private final String testServer = "play.hypixel.net";