@Test public void testSuccess() throws Exception { ByteArrayInputStream stream = new ByteArrayInputStream("Report data".getBytes(AdHocReportDownloadHelper.REPORT_CHARSET)); RawReportDownloadResponse rawResponse = new RawReportDownloadResponse(200, stream, AdHocReportDownloadHelper.REPORT_CHARSET, DownloadFormat.CSV.name()); ReportDownloadResponse response = downloadReport(DownloadFormat.CSV, rawResponse, null); assertEquals(200, response.getHttpStatus()); assertEquals(stream, response.getInputStream()); assertEquals("SUCCESS", response.getHttpResponseMessage()); }
@Override public ReportDownloadResponse downloadReport(ReportDefinition reportDefinition) throws ReportException, ReportDownloadResponseException { return adHocReportDownloadHelper.downloadReport( new XmlReportDefinitionRequest(reportDefinition), new DetailedReportDownloadResponseException.Builder()); }
ReportDownloader implements ReportDownloaderInterface { @Override public ReportDownloadResponse downloadReport(ReportDefinition reportDefinition) throws ReportException, ReportDownloadResponseException { return adHocReportDownloadHelper.downloadReport( new XmlReportDefinitionRequest(reportDefinition), new DetailedReportDownloadResponseException.Builder()); } }
ReportDownloader implements ReportDownloaderInterface { @Override public ReportDownloadResponse downloadReport(ReportDefinition reportDefinition) throws ReportException, ReportDownloadResponseException { return adHocReportDownloadHelper.downloadReport( new XmlReportDefinitionRequest(reportDefinition), new DetailedReportDownloadResponseException.Builder()); } ReportDownloader(AdWordsSession session); @Inject  ReportDownloader(AdHocReportDownloadHelper adHocReportDownloadHelper); }
ReportDownloader implements ReportDownloaderInterface { @Override public ReportDownloadResponse downloadReport(ReportDefinition reportDefinition) throws ReportException, ReportDownloadResponseException { return adHocReportDownloadHelper.downloadReport( new XmlReportDefinitionRequest(reportDefinition), new DetailedReportDownloadResponseException.Builder()); } ReportDownloader(AdWordsSession session); @Inject  ReportDownloader(AdHocReportDownloadHelper adHocReportDownloadHelper); @Override ReportDownloadResponse downloadReport(ReportDefinition reportDefinition); @Override ReportDownloadResponse downloadReport(String reportQuery, DownloadFormat format); @Override int getReportDownloadTimeout(); @Override void setReportDownloadTimeout(int reportDownloadTimeout); }
ReportDownloader implements ReportDownloaderInterface { @Override public ReportDownloadResponse downloadReport(ReportDefinition reportDefinition) throws ReportException, ReportDownloadResponseException { return adHocReportDownloadHelper.downloadReport( new XmlReportDefinitionRequest(reportDefinition), new DetailedReportDownloadResponseException.Builder()); } ReportDownloader(AdWordsSession session); @Inject  ReportDownloader(AdHocReportDownloadHelper adHocReportDownloadHelper); @Override ReportDownloadResponse downloadReport(ReportDefinition reportDefinition); @Override ReportDownloadResponse downloadReport(String reportQuery, DownloadFormat format); @Override int getReportDownloadTimeout(); @Override void setReportDownloadTimeout(int reportDownloadTimeout);  }