@Test
public void testWaitForJobCompletion() throws Exception {

  // Return completed job.
  when(mockJobsGet.execute()).thenReturn(job);
  // Run waitForJobCompletion.
  BigQueryUtils.waitForJobCompletion(mockBigQuery, projectId, jobReference, mockProgressable);
  // Verify that the method terminates and that the correct calls were sent to the mock BigQuery.
  verify(mockBigQuery).jobs();
  verify(mockBigQueryJobs).get(projectId, jobReference.getJobId());
  verify(mockJobsGet).execute();
  verify(mockProgressable, never()).progress();
}