Mockito 能测试 XML 上传 Service,前提是解耦 I/O 依赖:将 MultipartFile 替换为 InputStream 参数,用 mock(InputStream 控制输入;HTTP 客户端需接口注...