用Java模拟公共接口,我无法模拟接口

时间:2019-02-14 10:11:32

标签: junit interface mocking

enter code here

我的课程需要测试  公共类FASTapiController; `@RequestMapping(value =“ / downloadAttachments”,方法= RequestMethod.GET,   产生=“应用程序/ pdf”)     公共无效downloadAttachment(HttpServletResponse响应)引发     SpringException {         byte [] bdata = null;         字符串fileName = null;         InputStream myInputStream = null;         BufferedOutputStream fos = null;         尝试{             AttachmentDTO attachmentDTO = manageCampaignServices.downloadAttachment(attachmentIndex);             长bloblength =附件DTO.getAttachmentContent()。length();             bdata = attachmentDTO.getAttachmentContent()。getBytes(1,bloblength.intValue());             fileName = attachmentDTO.getAttachmentName();

response.reset();

公共接口ManageCampaignService {     public AttachmentDTO downloadAttachment(String attachmentID)抛出ClipsException; } }

0 个答案:

没有答案