From a1ad295e0cbad8f3e2d9c77ab31598d1d542806c Mon Sep 17 00:00:00 2001 From: Liam Date: Fri, 12 Apr 2024 18:48:13 +0100 Subject: [PATCH] fix skin part tests --- .../java/cc/fascinated/common/ImageUtils.java | 1 - .../fascinated/controller/PlayerController.java | 1 - .../fascinated/tests/PlayerControllerTests.java | 15 +++++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/cc/fascinated/common/ImageUtils.java b/src/main/java/cc/fascinated/common/ImageUtils.java index c3db34f..b06b436 100644 --- a/src/main/java/cc/fascinated/common/ImageUtils.java +++ b/src/main/java/cc/fascinated/common/ImageUtils.java @@ -9,7 +9,6 @@ import java.awt.*; import java.awt.geom.AffineTransform; import java.awt.image.BufferedImage; import java.io.ByteArrayOutputStream; -import java.io.IOException; @Log4j2 public class ImageUtils { diff --git a/src/main/java/cc/fascinated/controller/PlayerController.java b/src/main/java/cc/fascinated/controller/PlayerController.java index 85ec0c7..e806978 100644 --- a/src/main/java/cc/fascinated/controller/PlayerController.java +++ b/src/main/java/cc/fascinated/controller/PlayerController.java @@ -2,7 +2,6 @@ package cc.fascinated.controller; import cc.fascinated.model.cache.CachedPlayer; import cc.fascinated.model.cache.CachedPlayerName; -import cc.fascinated.model.skin.Skin; import cc.fascinated.service.PlayerService; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; diff --git a/src/test/java/cc/fascinated/tests/PlayerControllerTests.java b/src/test/java/cc/fascinated/tests/PlayerControllerTests.java index f278c67..030c2ff 100644 --- a/src/test/java/cc/fascinated/tests/PlayerControllerTests.java +++ b/src/test/java/cc/fascinated/tests/PlayerControllerTests.java @@ -1,7 +1,7 @@ package cc.fascinated.tests; import cc.fascinated.config.TestRedisConfig; -import cc.fascinated.model.skin.Skin; +import cc.fascinated.model.skin.ISkinPart; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; @@ -70,11 +70,14 @@ class PlayerControllerTests { @Test public void ensurePlayerSkinPartsLookupSuccess() throws Exception { - for (Skin.Parts part : Skin.Parts.values()) { - mockMvc.perform(get("/player/" + part.getName() + "/" + testPlayerUuid) - .accept(MediaType.IMAGE_PNG) - .contentType(MediaType.IMAGE_PNG)) - .andExpect(status().isOk()); + for (Enum[] type : ISkinPart.TYPES) { + for (Enum part : type) { + mockMvc.perform(get("/player/" + part.name().toLowerCase() + "/" + testPlayer) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON)) + .andExpect(status().isOk()); + } + } }