mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-25 07:30:46 +08:00
Implement real async COS image upload
This commit is contained in:
@@ -49,7 +49,7 @@ class UserControllerTest {
|
||||
@Test
|
||||
void uploadAvatar() throws Exception {
|
||||
MockMultipartFile file = new MockMultipartFile("file", "a.png", MediaType.IMAGE_PNG_VALUE, "img".getBytes());
|
||||
Mockito.when(imageUploader.upload(any(), eq("a.png"))).thenReturn("http://img/a.png");
|
||||
Mockito.when(imageUploader.upload(any(), eq("a.png"))).thenReturn(java.util.concurrent.CompletableFuture.completedFuture("http://img/a.png"));
|
||||
|
||||
mockMvc.perform(multipart("/api/users/me/avatar").file(file).principal(new UsernamePasswordAuthenticationToken("alice","p")))
|
||||
.andExpect(status().isOk())
|
||||
|
||||
Reference in New Issue
Block a user