ConversionAdjustmentUploadServiceClient implements BackgroundResource { public final UploadConversionAdjustmentsResponse uploadConversionAdjustments( String customerId, List<ConversionAdjustment> conversionAdjustments, boolean partialFailure) { UploadConversionAdjustmentsRequest request = UploadConversionAdjustmentsRequest.newBuilder() .setCustomerId(customerId) .addAllConversionAdjustments(conversionAdjustments) .setPartialFailure(partialFailure) .build(); return uploadConversionAdjustments(request); } protected  ConversionAdjustmentUploadServiceClient(
      ConversionAdjustmentUploadServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  ConversionAdjustmentUploadServiceClient(ConversionAdjustmentUploadServiceStub stub); static final ConversionAdjustmentUploadServiceClient create(); static final ConversionAdjustmentUploadServiceClient create(
      ConversionAdjustmentUploadServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final ConversionAdjustmentUploadServiceClient create(
      ConversionAdjustmentUploadServiceStub stub); final ConversionAdjustmentUploadServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") ConversionAdjustmentUploadServiceStub getStub(); final UploadConversionAdjustmentsResponse uploadConversionAdjustments(
      String customerId, List<ConversionAdjustment> conversionAdjustments, boolean partialFailure); final UploadConversionAdjustmentsResponse uploadConversionAdjustments(
      UploadConversionAdjustmentsRequest request); final UnaryCallable<
          UploadConversionAdjustmentsRequest, UploadConversionAdjustmentsResponse> uploadConversionAdjustmentsCallable(); @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 uploadConversionAdjustmentsTest() { UploadConversionAdjustmentsResponse expectedResponse = UploadConversionAdjustmentsResponse.newBuilder().build(); mockConversionAdjustmentUploadService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; List<ConversionAdjustment> conversionAdjustments = new ArrayList<>(); boolean partialFailure = true; UploadConversionAdjustmentsResponse actualResponse = client.uploadConversionAdjustments(customerId, conversionAdjustments, partialFailure); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockConversionAdjustmentUploadService.getRequests(); Assert.assertEquals(1, actualRequests.size()); UploadConversionAdjustmentsRequest actualRequest = (UploadConversionAdjustmentsRequest) actualRequests.get(0); Assert.assertEquals(customerId, actualRequest.getCustomerId()); Assert.assertEquals(conversionAdjustments, actualRequest.getConversionAdjustmentsList()); Assert.assertEquals(partialFailure, actualRequest.getPartialFailure()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void uploadConversionAdjustmentsExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockConversionAdjustmentUploadService.addException(exception); try { String customerId = "customerId-1772061412"; List<ConversionAdjustment> conversionAdjustments = new ArrayList<>(); boolean partialFailure = true; client.uploadConversionAdjustments(customerId, conversionAdjustments, partialFailure); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }