AdGroupCriterionServiceClient implements BackgroundResource { public final MutateAdGroupCriteriaResponse mutateAdGroupCriteria( String customerId, List<AdGroupCriterionOperation> operations) { MutateAdGroupCriteriaRequest request = MutateAdGroupCriteriaRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateAdGroupCriteria(request); } protected  AdGroupCriterionServiceClient(AdGroupCriterionServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  AdGroupCriterionServiceClient(AdGroupCriterionServiceStub stub); static final AdGroupCriterionServiceClient create(); static final AdGroupCriterionServiceClient create(AdGroupCriterionServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final AdGroupCriterionServiceClient create(AdGroupCriterionServiceStub stub); final AdGroupCriterionServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") AdGroupCriterionServiceStub getStub(); final AdGroupCriterion getAdGroupCriterion(AdGroupCriterionName resourceName); final AdGroupCriterion getAdGroupCriterion(String resourceName); final AdGroupCriterion getAdGroupCriterion(GetAdGroupCriterionRequest request); final UnaryCallable<GetAdGroupCriterionRequest, AdGroupCriterion> getAdGroupCriterionCallable(); final MutateAdGroupCriteriaResponse mutateAdGroupCriteria(
      String customerId, List<AdGroupCriterionOperation> operations); final MutateAdGroupCriteriaResponse mutateAdGroupCriteria(
      MutateAdGroupCriteriaRequest request); final UnaryCallable<MutateAdGroupCriteriaRequest, MutateAdGroupCriteriaResponse> mutateAdGroupCriteriaCallable(); @Override final void close(); @Override void shutdown(); @Override boolean isShutdown(); @Override boolean isTerminated(); @Override void shutdownNow(); @Override boolean awaitTermination(long duration, TimeUnit unit);  }
@Test @SuppressWarnings("all") public void mutateAdGroupCriteriaTest() { MutateAdGroupCriteriaResponse expectedResponse = MutateAdGroupCriteriaResponse.newBuilder().build(); mockAdGroupCriterionService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<AdGroupCriterionOperation> operations = new ArrayList<>(); MutateAdGroupCriteriaResponse actualResponse = client.mutateAdGroupCriteria(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockAdGroupCriterionService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateAdGroupCriteriaRequest actualRequest = (MutateAdGroupCriteriaRequest) actualRequests.get(0); Assert.assertEquals(customerId, actualRequest.getCustomerId()); Assert.assertEquals(operations, actualRequest.getOperationsList()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void mutateAdGroupCriteriaExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockAdGroupCriterionService.addException(exception); try { String customerId = "customerId-1772061412"; List<AdGroupCriterionOperation> operations = new ArrayList<>(); client.mutateAdGroupCriteria(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }