OfflineUserDataJobServiceClient implements BackgroundResource { public final CreateOfflineUserDataJobResponse createOfflineUserDataJob( String customerId, OfflineUserDataJob job) { CreateOfflineUserDataJobRequest request = CreateOfflineUserDataJobRequest.newBuilder().setCustomerId(customerId).setJob(job).build(); return createOfflineUserDataJob(request); } protected  OfflineUserDataJobServiceClient(OfflineUserDataJobServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  OfflineUserDataJobServiceClient(OfflineUserDataJobServiceStub stub); static final OfflineUserDataJobServiceClient create(); static final OfflineUserDataJobServiceClient create(
      OfflineUserDataJobServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final OfflineUserDataJobServiceClient create(OfflineUserDataJobServiceStub stub); final OfflineUserDataJobServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") OfflineUserDataJobServiceStub getStub(); @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") final OperationsClient getOperationsClient(); @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") final OperationFuture<Empty, Empty> runOfflineUserDataJobAsync(
      OfflineUserDataJobName resourceName); @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") final OperationFuture<Empty, Empty> runOfflineUserDataJobAsync(String resourceName); @BetaApi( "The surface for long-running operations is not stable yet and may change in the future.") final OperationFuture<Empty, Empty> runOfflineUserDataJobAsync(
      RunOfflineUserDataJobRequest request); @BetaApi("The surface for use by generated code is not stable yet and may change in the future.") final OperationCallable<RunOfflineUserDataJobRequest, Empty, Empty> runOfflineUserDataJobOperationCallable(); final UnaryCallable<RunOfflineUserDataJobRequest, Operation> runOfflineUserDataJobCallable(); final CreateOfflineUserDataJobResponse createOfflineUserDataJob(
      String customerId, OfflineUserDataJob job); final CreateOfflineUserDataJobResponse createOfflineUserDataJob(
      CreateOfflineUserDataJobRequest request); final UnaryCallable<CreateOfflineUserDataJobRequest, CreateOfflineUserDataJobResponse> createOfflineUserDataJobCallable(); final OfflineUserDataJob getOfflineUserDataJob(OfflineUserDataJobName resourceName); final OfflineUserDataJob getOfflineUserDataJob(String resourceName); final OfflineUserDataJob getOfflineUserDataJob(GetOfflineUserDataJobRequest request); final UnaryCallable<GetOfflineUserDataJobRequest, OfflineUserDataJob> getOfflineUserDataJobCallable(); final AddOfflineUserDataJobOperationsResponse addOfflineUserDataJobOperations(
      OfflineUserDataJobName resourceName, List<OfflineUserDataJobOperation> operations); final AddOfflineUserDataJobOperationsResponse addOfflineUserDataJobOperations(
      String resourceName, List<OfflineUserDataJobOperation> operations); final AddOfflineUserDataJobOperationsResponse addOfflineUserDataJobOperations(
      AddOfflineUserDataJobOperationsRequest request); final UnaryCallable<
          AddOfflineUserDataJobOperationsRequest, AddOfflineUserDataJobOperationsResponse> addOfflineUserDataJobOperationsCallable(); @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 createOfflineUserDataJobTest() { String resourceName = "resourceName979421212"; CreateOfflineUserDataJobResponse expectedResponse = CreateOfflineUserDataJobResponse.newBuilder().setResourceName(resourceName).build(); mockOfflineUserDataJobService.addResponse(expectedResponse); String customerId = "customerId-1772061412"; OfflineUserDataJob job = OfflineUserDataJob.newBuilder().build(); CreateOfflineUserDataJobResponse actualResponse = client.createOfflineUserDataJob(customerId, job); Assert.assertEquals(expectedResponse, actualResponse); List<AbstractMessage> actualRequests = mockOfflineUserDataJobService.getRequests(); Assert.assertEquals(1, actualRequests.size()); CreateOfflineUserDataJobRequest actualRequest = (CreateOfflineUserDataJobRequest) actualRequests.get(0); Assert.assertEquals(customerId, actualRequest.getCustomerId()); Assert.assertEquals(job, actualRequest.getJob()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void createOfflineUserDataJobExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockOfflineUserDataJobService.addException(exception); try { String customerId = "customerId-1772061412"; OfflineUserDataJob job = OfflineUserDataJob.newBuilder().build(); client.createOfflineUserDataJob(customerId, job); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }