WorkItemStatusClient { @VisibleForTesting synchronized void populateProgress(WorkItemStatus status) throws Exception { Progress progress = worker.getWorkerProgress(); if (progress != null) { status.setReportedProgress(SourceTranslationUtils.readerProgressToCloudProgress(progress)); } } WorkItemStatusClient(WorkUnitClient workUnitClient, WorkItem workItem); String uniqueWorkId(); synchronized void setWorker(
      DataflowWorkExecutor worker, BatchModeExecutionContext executionContext); synchronized WorkItemServiceState reportError(Throwable e); synchronized WorkItemServiceState reportSuccess(); synchronized WorkItemServiceState reportUpdate(
      @Nullable DynamicSplitResult dynamicSplitResult, Duration requestedLeaseDuration); Iterable<CounterUpdate> extractMsecCounters(boolean isFinalUpdate); long extractThrottleTime();  }
@Test public void populateProgress() throws Exception { WorkItemStatus status = new WorkItemStatus(); Progress progress = cloudProgressToReaderProgress(ReaderTestUtils.approximateProgressAtIndex(42L)); when(worker.getWorkerProgress()).thenReturn(progress); statusClient.setWorker(worker, executionContext); statusClient.populateProgress(status); assertThat( status.getReportedProgress(), equalTo(ReaderTestUtils.approximateProgressAtIndex(42L))); }