Search in sources :

Example 6 with ReportDownloadResponse

use of com.google.api.ads.adwords.lib.utils.ReportDownloadResponse in project googleads-java-lib by googleads.

the class ReportDownloaderTest method testSuccess.

@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());
}
Also used : RawReportDownloadResponse(com.google.api.ads.adwords.lib.utils.RawReportDownloadResponse) ReportDownloadResponse(com.google.api.ads.adwords.lib.utils.ReportDownloadResponse) ByteArrayInputStream(java.io.ByteArrayInputStream) RawReportDownloadResponse(com.google.api.ads.adwords.lib.utils.RawReportDownloadResponse) Test(org.junit.Test)

Aggregations

ReportDownloadResponse (com.google.api.ads.adwords.lib.utils.ReportDownloadResponse)6 ReportingConfiguration (com.google.api.ads.adwords.lib.client.reporting.ReportingConfiguration)4 ReportDefinition (com.google.api.ads.adwords.lib.jaxb.v201809.ReportDefinition)3 ReportDownloaderInterface (com.google.api.ads.adwords.lib.utils.v201809.ReportDownloaderInterface)3 Selector (com.google.api.ads.adwords.lib.jaxb.v201809.Selector)2 RawReportDownloadResponse (com.google.api.ads.adwords.lib.utils.RawReportDownloadResponse)2 ReportQuery (com.google.api.ads.adwords.lib.utils.v201809.ReportQuery)2 Campaign (com.google.api.ads.adwords.axis.v201809.cm.Campaign)1 CampaignPage (com.google.api.ads.adwords.axis.v201809.cm.CampaignPage)1 CampaignServiceInterface (com.google.api.ads.adwords.axis.v201809.cm.CampaignServiceInterface)1 Paging (com.google.api.ads.adwords.axis.v201809.cm.Paging)1 Selector (com.google.api.ads.adwords.axis.v201809.cm.Selector)1 ReportRequest (com.google.api.ads.adwords.lib.utils.ReportRequest)1 Builder (com.google.api.ads.adwords.lib.utils.v201809.DetailedReportDownloadResponseException.Builder)1 ReportDownloader (com.google.api.ads.adwords.lib.utils.v201809.ReportDownloader)1 Splitter (com.google.common.base.Splitter)1 BufferedReader (java.io.BufferedReader)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 File (java.io.File)1 FileOutputStream (java.io.FileOutputStream)1