CustomerNegativeCriterionServiceClient implements BackgroundResource { public final MutateCustomerNegativeCriteriaResponse mutateCustomerNegativeCriteria( String customerId, List<CustomerNegativeCriterionOperation> operations) { MutateCustomerNegativeCriteriaRequest request = MutateCustomerNegativeCriteriaRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateCustomerNegativeCriteria(request); } protected  CustomerNegativeCriterionServiceClient(
      CustomerNegativeCriterionServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  CustomerNegativeCriterionServiceClient(CustomerNegativeCriterionServiceStub stub); static final CustomerNegativeCriterionServiceClient create(); static final CustomerNegativeCriterionServiceClient create(
      CustomerNegativeCriterionServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final CustomerNegativeCriterionServiceClient create(
      CustomerNegativeCriterionServiceStub stub); final CustomerNegativeCriterionServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") CustomerNegativeCriterionServiceStub getStub(); final CustomerNegativeCriterion getCustomerNegativeCriterion(
      CustomerNegativeCriterionName resourceName); final CustomerNegativeCriterion getCustomerNegativeCriterion(String resourceName); final CustomerNegativeCriterion getCustomerNegativeCriterion(
      GetCustomerNegativeCriterionRequest request); final UnaryCallable<GetCustomerNegativeCriterionRequest, CustomerNegativeCriterion> getCustomerNegativeCriterionCallable(); final MutateCustomerNegativeCriteriaResponse mutateCustomerNegativeCriteria(
      String customerId, List<CustomerNegativeCriterionOperation> operations); final MutateCustomerNegativeCriteriaResponse mutateCustomerNegativeCriteria(
      MutateCustomerNegativeCriteriaRequest request); final UnaryCallable<
          MutateCustomerNegativeCriteriaRequest, MutateCustomerNegativeCriteriaResponse> mutateCustomerNegativeCriteriaCallable(); @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 mutateCustomerNegativeCriteriaTest() { MutateCustomerNegativeCriteriaResponse expectedResponse = MutateCustomerNegativeCriteriaResponse.newBuilder().build(); mockCustomerNegativeCriterionService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<CustomerNegativeCriterionOperation> operations = new ArrayList<>(); MutateCustomerNegativeCriteriaResponse actualResponse = client.mutateCustomerNegativeCriteria(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockCustomerNegativeCriterionService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateCustomerNegativeCriteriaRequest actualRequest = (MutateCustomerNegativeCriteriaRequest) 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 mutateCustomerNegativeCriteriaExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockCustomerNegativeCriterionService.addException(exception); try { String customerId = "customerId-1772061412"; List<CustomerNegativeCriterionOperation> operations = new ArrayList<>(); client.mutateCustomerNegativeCriteria(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }