Search in sources :

Example 6 with BatchJobMutateResponse

use of com.google.api.ads.adwords.jaxws.utils.v201809.batchjob.BatchJobMutateResponse in project googleads-java-lib by googleads.

the class JaxWsDeserializationTest method testDeserializeBatchJobResponseWithoutErrors.

/**
 * Tests that a response without errors will be properly deserialized.
 */
@Test
public void testDeserializeBatchJobResponseWithoutErrors() throws Exception {
    Source source = new StreamSource(JaxWsDeserializationTest.class.getResourceAsStream("resources/BatchJobMutate.responseWithoutErrors.xml"));
    BatchJobMutateResponse response = deserializer.deserialize(source);
    assertNotNull(response);
    // Expect: Campaign, AdGroup, BiddableAdGroupCriterion, BiddableAdGroupCriterion
    assertEquals(4, response.getMutateResults().length);
    assertNotNull(response.getMutateResults()[0].getOperand().getCampaign());
    assertNotNull(response.getMutateResults()[1].getOperand().getAdGroup());
    assertNotNull(response.getMutateResults()[2].getOperand().getAdGroupCriterion());
    assertThat(response.getMutateResults()[3].getOperand().getAdGroupCriterion(), Matchers.instanceOf(BiddableAdGroupCriterion.class));
    assertNotNull(response.getMutateResults()[3].getOperand().getAdGroupCriterion());
    assertThat(response.getMutateResults()[3].getOperand().getAdGroupCriterion(), Matchers.instanceOf(BiddableAdGroupCriterion.class));
}
Also used : BatchJobMutateResponse(com.google.api.ads.adwords.jaxws.utils.v201809.batchjob.BatchJobMutateResponse) BiddableAdGroupCriterion(com.google.api.ads.adwords.jaxws.v201809.cm.BiddableAdGroupCriterion) StreamSource(javax.xml.transform.stream.StreamSource) StreamSource(javax.xml.transform.stream.StreamSource) Source(javax.xml.transform.Source) Test(org.junit.Test)

Aggregations

BatchJobMutateResponse (com.google.api.ads.adwords.jaxws.utils.v201809.batchjob.BatchJobMutateResponse)4 BiddableAdGroupCriterion (com.google.api.ads.adwords.jaxws.v201809.cm.BiddableAdGroupCriterion)4 Test (org.junit.Test)4 SelectorBuilder (com.google.api.ads.adwords.axis.utils.v201809.SelectorBuilder)2 BatchJobHelper (com.google.api.ads.adwords.axis.utils.v201809.batchjob.BatchJobHelper)2 BatchJobMutateResponse (com.google.api.ads.adwords.axis.utils.v201809.batchjob.BatchJobMutateResponse)2 MutateResult (com.google.api.ads.adwords.axis.utils.v201809.batchjob.MutateResult)2 AdGroupCriterionOperation (com.google.api.ads.adwords.axis.v201809.cm.AdGroupCriterionOperation)2 BatchJob (com.google.api.ads.adwords.axis.v201809.cm.BatchJob)2 BatchJobOperation (com.google.api.ads.adwords.axis.v201809.cm.BatchJobOperation)2 BatchJobProcessingError (com.google.api.ads.adwords.axis.v201809.cm.BatchJobProcessingError)2 BatchJobServiceInterface (com.google.api.ads.adwords.axis.v201809.cm.BatchJobServiceInterface)2 Selector (com.google.api.ads.adwords.axis.v201809.cm.Selector)2 CriterionError (com.google.api.ads.adwords.jaxws.v201809.cm.CriterionError)2 ArrayList (java.util.ArrayList)2 TimeoutException (java.util.concurrent.TimeoutException)2 Source (javax.xml.transform.Source)2 StreamSource (javax.xml.transform.stream.StreamSource)2 AdGroupAdOperation (com.google.api.ads.adwords.axis.v201809.cm.AdGroupAdOperation)1 AdGroupOperation (com.google.api.ads.adwords.axis.v201809.cm.AdGroupOperation)1