From de338fed82b1042d5fce056bb6abe69a3120e718 Mon Sep 17 00:00:00 2001 From: Liam Date: Wed, 10 Apr 2024 14:39:12 +0100 Subject: [PATCH] add blocked server test --- .../cc/fascinated/{ => config}/TestRedisConfig.java | 2 +- .../{ => tests}/PlayerControllerTests.java | 2 +- .../{ => tests}/ServerControllerTests.java | 12 ++++++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) rename src/test/java/cc/fascinated/{ => config}/TestRedisConfig.java (97%) rename src/test/java/cc/fascinated/{ => tests}/PlayerControllerTests.java (98%) rename src/test/java/cc/fascinated/{ => tests}/ServerControllerTests.java (81%) diff --git a/src/test/java/cc/fascinated/TestRedisConfig.java b/src/test/java/cc/fascinated/config/TestRedisConfig.java similarity index 97% rename from src/test/java/cc/fascinated/TestRedisConfig.java rename to src/test/java/cc/fascinated/config/TestRedisConfig.java index d7d21e6..2a408bf 100644 --- a/src/test/java/cc/fascinated/TestRedisConfig.java +++ b/src/test/java/cc/fascinated/config/TestRedisConfig.java @@ -1,4 +1,4 @@ -package cc.fascinated; +package cc.fascinated.config; import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; diff --git a/src/test/java/cc/fascinated/PlayerControllerTests.java b/src/test/java/cc/fascinated/tests/PlayerControllerTests.java similarity index 98% rename from src/test/java/cc/fascinated/PlayerControllerTests.java rename to src/test/java/cc/fascinated/tests/PlayerControllerTests.java index b7916a6..245aec7 100644 --- a/src/test/java/cc/fascinated/PlayerControllerTests.java +++ b/src/test/java/cc/fascinated/tests/PlayerControllerTests.java @@ -1,4 +1,4 @@ -package cc.fascinated; +package cc.fascinated.tests; import cc.fascinated.model.player.Skin; import org.junit.jupiter.api.Test; diff --git a/src/test/java/cc/fascinated/ServerControllerTests.java b/src/test/java/cc/fascinated/tests/ServerControllerTests.java similarity index 81% rename from src/test/java/cc/fascinated/ServerControllerTests.java rename to src/test/java/cc/fascinated/tests/ServerControllerTests.java index 05e310f..ad0f1ba 100644 --- a/src/test/java/cc/fascinated/ServerControllerTests.java +++ b/src/test/java/cc/fascinated/tests/ServerControllerTests.java @@ -1,6 +1,5 @@ -package cc.fascinated; +package cc.fascinated.tests; -import cc.fascinated.model.player.Skin; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; @@ -42,4 +41,13 @@ class ServerControllerTests { .contentType(MediaType.IMAGE_PNG)) .andExpect(status().isOk()); } + + @Test + public void ensureBlockedServerLookupSuccess() throws Exception { + mockMvc.perform(get("/server/blocked/play.hypixel.net") + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.blocked").value(false)); + } }