添加多运行环境支持 #14
@@ -327,7 +327,7 @@ public class BaseTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public static class TestQiniuFileServiceImpl implements FileManager {
|
public static class TestFileManager implements FileManager {
|
||||||
@Override
|
@Override
|
||||||
public FileResponse uploadFile(InputStream is, String fileName) {
|
public FileResponse uploadFile(InputStream is, String fileName) {
|
||||||
FileResponse response = new FileResponse();
|
FileResponse response = new FileResponse();
|
||||||
|
|||||||
@@ -116,8 +116,7 @@ public class UserControllerTest extends BaseTest {
|
|||||||
assertNotNull(inputStream);
|
assertNotNull(inputStream);
|
||||||
|
|
||||||
// mock 实现类
|
// mock 实现类
|
||||||
// FIXME :: mock 时不应该为 qiniuService
|
mockInjectInstance(userService, "fileService", (FileService) TestFileManager::new);
|
||||||
// mockInjectInstance(userService, "fileService", (FileService) TestQiniuFileServiceImpl::new);
|
|
||||||
|
|
||||||
MockMultipartFile file = new MockMultipartFile("file", "logo.png", MediaType.IMAGE_PNG_VALUE, inputStream);
|
MockMultipartFile file = new MockMultipartFile("file", "logo.png", MediaType.IMAGE_PNG_VALUE, inputStream);
|
||||||
getMockData(multipart("/user/imgUpload").file(file), userLogin()).andDo(result -> {
|
getMockData(multipart("/user/imgUpload").file(file), userLogin()).andDo(result -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user