@Test
public void testCommitJob() throws IOException {

  // Setup the sample directory.
  generateSampleFiles();
  committer.commitJob(job);
  // Setup a captor for the GCS paths argument
  @SuppressWarnings({"rawtypes", "unchecked", "cast"})
  // Class<List> is neither a sub/supertype of Class<List<String>>, the latter doesn't even exist.
  Class<List<String>> listClass = (Class<List<String>>) (Class) List.class;
  ArgumentCaptor<List<String>> gcsOutputFileCaptor = ArgumentCaptor.forClass(listClass);
  // Verify we're making the BigQuery import call.
  verify(mockBigQueryHelper)
      .importFederatedFromGcs(
          eq(TEST_PROJECT_ID),
          eq(outputTableRef),
          eq(TEST_TABLE_SCHEMA.get()),
          eq(TEST_FILE_FORMAT),
          gcsOutputFileCaptor.capture());
  // Verify the delegate is being called.
  verify(mockCommitter).commitJob(eq(job));
  // Assert the passed files contains our sample file.
  assertThat(gcsOutputFileCaptor.getValue()).containsExactly(TEST_OUTPUT_FILE_STRING);
}