ConversionActionServiceClient implements BackgroundResource { public final MutateConversionActionsResponse mutateConversionActions( String customerId, List<ConversionActionOperation> operations) { MutateConversionActionsRequest request = MutateConversionActionsRequest.newBuilder() .setCustomerId(customerId) .addAllOperations(operations) .build(); return mutateConversionActions(request); } protected  ConversionActionServiceClient(ConversionActionServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  ConversionActionServiceClient(ConversionActionServiceStub stub); static final ConversionActionServiceClient create(); static final ConversionActionServiceClient create(ConversionActionServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final ConversionActionServiceClient create(ConversionActionServiceStub stub); final ConversionActionServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") ConversionActionServiceStub getStub(); final ConversionAction getConversionAction(ConversionActionName resourceName); final ConversionAction getConversionAction(String resourceName); final ConversionAction getConversionAction(GetConversionActionRequest request); final UnaryCallable<GetConversionActionRequest, ConversionAction> getConversionActionCallable(); final MutateConversionActionsResponse mutateConversionActions(
      String customerId, List<ConversionActionOperation> operations); final MutateConversionActionsResponse mutateConversionActions(
      MutateConversionActionsRequest request); final UnaryCallable<MutateConversionActionsRequest, MutateConversionActionsResponse> mutateConversionActionsCallable(); @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 mutateConversionActionsTest() { MutateConversionActionsResponse expectedResponse = MutateConversionActionsResponse.newBuilder().build(); mockConversionActionService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<ConversionActionOperation> operations = new ArrayList<>(); MutateConversionActionsResponse actualResponse = client.mutateConversionActions(customerId, operations); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockConversionActionService.getRequests(); Assert.assertEquals(1, actualRequests.size()); MutateConversionActionsRequest actualRequest = (MutateConversionActionsRequest) 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 mutateConversionActionsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockConversionActionService.addException(exception); try { String customerId = "customerId-1772061412"; List<ConversionActionOperation> operations = new ArrayList<>(); client.mutateConversionActions(customerId, operations); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }