@Test(dependsOnMethods = {"testUploadMedia"}, dataProvider = "downloadMedia") public void testDownload(String mediaId) throws WxErrorException { File file = this.wxService.getMediaService().download(mediaId); assertThat(file).isNotNull(); System.out.println(file); }
@Override public File download(String mediaId) throws WxErrorException { return this.mainService.execute( BaseMediaDownloadRequestExecutor.create(this.mainService.getRequestHttp(), this.mainService.getWxCpConfigStorage().getTmpDirFile()), MEDIA_GET_URL, "media_id=" + mediaId); }
WxCpMediaServiceImpl implements WxCpMediaService { @Override public File download(String mediaId) throws WxErrorException { return this.mainService.execute( BaseMediaDownloadRequestExecutor.create(this.mainService.getRequestHttp(), this.mainService.getWxCpConfigStorage().getTmpDirFile()), MEDIA_GET_URL, "media_id=" + mediaId); } }
WxCpMediaServiceImpl implements WxCpMediaService { @Override public File download(String mediaId) throws WxErrorException { return this.mainService.execute( BaseMediaDownloadRequestExecutor.create(this.mainService.getRequestHttp(), this.mainService.getWxCpConfigStorage().getTmpDirFile()), MEDIA_GET_URL, "media_id=" + mediaId); } WxCpMediaServiceImpl(WxCpService mainService); }
WxCpMediaServiceImpl implements WxCpMediaService { @Override public File download(String mediaId) throws WxErrorException { return this.mainService.execute( BaseMediaDownloadRequestExecutor.create(this.mainService.getRequestHttp(), this.mainService.getWxCpConfigStorage().getTmpDirFile()), MEDIA_GET_URL, "media_id=" + mediaId); } WxCpMediaServiceImpl(WxCpService mainService); @Override WxMediaUploadResult upload(String mediaType, String fileType, InputStream inputStream); @Override WxMediaUploadResult upload(String mediaType, File file); @Override File download(String mediaId); @Override File getJssdkFile(String mediaId); @Override String uploadImg(File file); }
WxCpMediaServiceImpl implements WxCpMediaService { @Override public File download(String mediaId) throws WxErrorException { return this.mainService.execute( BaseMediaDownloadRequestExecutor.create(this.mainService.getRequestHttp(), this.mainService.getWxCpConfigStorage().getTmpDirFile()), MEDIA_GET_URL, "media_id=" + mediaId); } WxCpMediaServiceImpl(WxCpService mainService); @Override WxMediaUploadResult upload(String mediaType, String fileType, InputStream inputStream); @Override WxMediaUploadResult upload(String mediaType, File file); @Override File download(String mediaId); @Override File getJssdkFile(String mediaId); @Override String uploadImg(File file);  }