forked from MinecraftUtilities/Backend
fix skin part tests
This commit is contained in:
parent
2ea58d8080
commit
a1ad295e0c
@ -9,7 +9,6 @@ import java.awt.*;
|
|||||||
import java.awt.geom.AffineTransform;
|
import java.awt.geom.AffineTransform;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
@Log4j2
|
@Log4j2
|
||||||
public class ImageUtils {
|
public class ImageUtils {
|
||||||
|
@ -2,7 +2,6 @@ package cc.fascinated.controller;
|
|||||||
|
|
||||||
import cc.fascinated.model.cache.CachedPlayer;
|
import cc.fascinated.model.cache.CachedPlayer;
|
||||||
import cc.fascinated.model.cache.CachedPlayerName;
|
import cc.fascinated.model.cache.CachedPlayerName;
|
||||||
import cc.fascinated.model.skin.Skin;
|
|
||||||
import cc.fascinated.service.PlayerService;
|
import cc.fascinated.service.PlayerService;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package cc.fascinated.tests;
|
package cc.fascinated.tests;
|
||||||
|
|
||||||
import cc.fascinated.config.TestRedisConfig;
|
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.junit.jupiter.api.Test;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
|
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
|
||||||
@ -70,12 +70,15 @@ class PlayerControllerTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void ensurePlayerSkinPartsLookupSuccess() throws Exception {
|
public void ensurePlayerSkinPartsLookupSuccess() throws Exception {
|
||||||
for (Skin.Parts part : Skin.Parts.values()) {
|
for (Enum<?>[] type : ISkinPart.TYPES) {
|
||||||
mockMvc.perform(get("/player/" + part.getName() + "/" + testPlayerUuid)
|
for (Enum<?> part : type) {
|
||||||
.accept(MediaType.IMAGE_PNG)
|
mockMvc.perform(get("/player/" + part.name().toLowerCase() + "/" + testPlayer)
|
||||||
.contentType(MediaType.IMAGE_PNG))
|
.accept(MediaType.APPLICATION_JSON)
|
||||||
|
.contentType(MediaType.APPLICATION_JSON))
|
||||||
.andExpect(status().isOk());
|
.andExpect(status().isOk());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user