aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com/juick
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/com/juick')
-rw-r--r--src/test/java/com/juick/server/tests/ServerTests.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java
index 33b0f0da..cea3818e 100644
--- a/src/test/java/com/juick/server/tests/ServerTests.java
+++ b/src/test/java/com/juick/server/tests/ServerTests.java
@@ -89,6 +89,7 @@ import org.springframework.core.io.Resource;
import org.springframework.http.*;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.mock.web.MockMultipartFile;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.test.web.client.MockRestServiceServer;
@@ -2077,7 +2078,7 @@ public class ServerTests {
ClassPathResource newAvatar = new ClassPathResource("static/durov.png");
byte[] newAvatarData = IOUtils.toByteArray(newAvatar.getInputStream());
mockMvc.perform(MockMvcRequestBuilders.multipart("/api/me/upload")
- .file("avatar", newAvatarData)
+ .file(new MockMultipartFile("avatar", "durov.png", "image/png", newAvatarData))
.with(httpBasic(freefdName, freefdPassword))
).andExpect(status().isOk());
String newHash = DigestUtils.md5DigestAsHex(newAvatarData);