@Override public BatchJobMutateResponse downloadBatchJobMutateResponse( String downloadUrl, int startIndex, int numberResults) throws BatchJobException { return impl.downloadBatchJobMutateResponse(downloadUrl, startIndex, numberResults); } }
@Override public BatchJobMutateResponse downloadBatchJobMutateResponse(String downloadUrl) throws BatchJobException { return impl.downloadBatchJobMutateResponse(downloadUrl); }
@Override public BatchJobMutateResponse downloadBatchJobMutateResponse( String downloadUrl, int startIndex, int numberResults) throws BatchJobException { return impl.downloadBatchJobMutateResponse(downloadUrl, startIndex, numberResults); } }
@Override public BatchJobMutateResponse downloadBatchJobMutateResponse( String downloadUrl, int startIndex, int numberResults) throws BatchJobException { return impl.downloadBatchJobMutateResponse(downloadUrl, startIndex, numberResults); } }
@Override public BatchJobMutateResponse downloadBatchJobMutateResponse( String downloadUrl, int startIndex, int numberResults) throws BatchJobException { return impl.downloadBatchJobMutateResponse(downloadUrl, startIndex, numberResults); } }
@Override public BatchJobMutateResponse downloadBatchJobMutateResponse(String downloadUrl) throws BatchJobException { return impl.downloadBatchJobMutateResponse(downloadUrl); }
@Override public BatchJobMutateResponse downloadBatchJobMutateResponse( String downloadUrl, int startIndex, int numberResults) throws BatchJobException { return impl.downloadBatchJobMutateResponse(downloadUrl, startIndex, numberResults); } }
@Override public BatchJobMutateResponse downloadBatchJobMutateResponse(String downloadUrl) throws BatchJobException { return impl.downloadBatchJobMutateResponse(downloadUrl); }
@Override public BatchJobMutateResponse downloadBatchJobMutateResponse(String downloadUrl) throws BatchJobException { return impl.downloadBatchJobMutateResponse(downloadUrl); }
@Override public BatchJobMutateResponse downloadBatchJobMutateResponse(String downloadUrl) throws BatchJobException { return impl.downloadBatchJobMutateResponse(downloadUrl); }
@Override public BatchJobMutateResponse downloadBatchJobMutateResponse(String downloadUrl) throws BatchJobException { return impl.downloadBatchJobMutateResponse(downloadUrl); }
@Override public BatchJobMutateResponse downloadBatchJobMutateResponse(String downloadUrl) throws BatchJobException { return impl.downloadBatchJobMutateResponse(downloadUrl); }
@Override public BatchJobMutateResponse downloadBatchJobMutateResponse( String downloadUrl, int startIndex, int numberResults) throws BatchJobException { return impl.downloadBatchJobMutateResponse(downloadUrl, startIndex, numberResults); } }
@Override public BatchJobMutateResponse downloadBatchJobMutateResponse( String downloadUrl, int startIndex, int numberResults) throws BatchJobException { return impl.downloadBatchJobMutateResponse(downloadUrl, startIndex, numberResults); } }
@Override public BatchJobMutateResponse downloadBatchJobMutateResponse(String downloadUrl) throws BatchJobException { return impl.downloadBatchJobMutateResponse(downloadUrl); }
@Override public BatchJobMutateResponse downloadBatchJobMutateResponse( String downloadUrl, int startIndex, int numberResults) throws BatchJobException { return impl.downloadBatchJobMutateResponse(downloadUrl, startIndex, numberResults); } }
@Test public void testDownloadBatchJobMutateResponse() throws BatchJobException, IOException { File tempFile = tempFolder.newFile(); OutputStream responseOutputStream = new FileOutputStream(tempFile); Streams.write(getResponseString(), responseOutputStream, StandardCharsets.UTF_8); ResponseT downloadResponse = batchJobHelper.downloadBatchJobMutateResponse(tempFile.toURI().toURL().toString()); assertDownloadResponse(downloadResponse); }
/** * Verifies that the helper handles the case where the response does not contain any results. */ @Test public void testDownloadBatchJobMutateResponse_emptyResponse() throws BatchJobException, IOException { String noResultsResponse = String.format("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<mutateResponse xmlns=\"https://adwords.google.com/api/adwords/cm/%s\">" + "</mutateResponse>", getVersion()); File tempFile = tempFolder.newFile(); OutputStream responseOutputStream = new FileOutputStream(tempFile); Streams.write(noResultsResponse, responseOutputStream, StandardCharsets.UTF_8); ResponseT downloadResponse = batchJobHelper.downloadBatchJobMutateResponse(tempFile.toURI().toURL().toString()); assertNotNull("Download response is null", downloadResponse); if (expectNullResultsForEmptyResponse()) { assertNull( "Mutate results of download response should be null", downloadResponse.getMutateResults()); } else { assertNotNull( "Mutate results of download response is null", downloadResponse.getMutateResults()); assertEquals( "Size of mutate results of an empty download response != 0", 0, downloadResponse.getMutateResults().length); } }