use of com.icthh.xm.ms.entity.service.StorageService in project xm-ms-entity by xm-online.
the class StorageResourceIntTest method storeObjectFileTooBig.
@Test
@Transactional
public void storeObjectFileTooBig() throws Exception {
MockMultipartFile file = new MockMultipartFile("file", "test.txt", "text/plain", "TEST".getBytes());
restStorageMockMvc.perform(fileUpload("/api/storage/objects").file(file)).andDo(result -> System.out.println(result.getResponse().getContentAsString())).andExpect(status().isBadRequest());
verify(storageService, times(0)).store(eq(file), eq(null));
}
use of com.icthh.xm.ms.entity.service.StorageService in project xm-ms-entity by xm-online.
the class StorageResourceIntTest method storeObjectSuccess.
@Test
@Transactional
public void storeObjectSuccess() throws Exception {
MockMultipartFile file = new MockMultipartFile("file", "test.txt", "text/plain", "TE".getBytes());
restStorageMockMvc.perform(fileUpload("/api/storage/objects").file(file)).andDo(result -> System.out.println(result.getResponse().getContentAsString())).andExpect(status().isOk());
verify(storageService).store(eq(file), eq(null));
}
use of com.icthh.xm.ms.entity.service.StorageService in project xm-ms-entity by xm-online.
the class StorageResourceIntTest method storeImageSuccess.
@Test
@Transactional
public void storeImageSuccess() throws Exception {
MockMultipartFile file = new MockMultipartFile("file", "test.txt", "image/plain", "TE".getBytes());
restStorageMockMvc.perform(fileUpload("/api/storage/objects?size=100").file(file)).andDo(result -> System.out.println(result.getResponse().getContentAsString())).andExpect(status().isOk());
verify(storageService).store(eq(file), eq(100));
}
Aggregations