@Test
public void testGetSplits() throws Exception {

  Configuration conf = new Configuration();
  UnshardedExportToCloudStorage export =
      new UnshardedExportToCloudStorage(
          conf,
          "path",
          ExportFileFormat.AVRO,
          new BigQueryHelper(null),
          "project-id",
          null, /* table */
          new InputFormat<LongWritable, Text>() {
            @Override
            public List<InputSplit> getSplits(JobContext jobContext) {
              return ImmutableList.<InputSplit>builder()
                  .add(new FileSplit(new Path("Foo"), 0L, 1L, new String[0]))
                  .add(new FileSplit(new Path("Bar"), 0L, 1L, new String[0]))
                  .build();
            }
            @Override
            public RecordReader<LongWritable, Text> createRecordReader(
                InputSplit inputSplit, TaskAttemptContext taskAttemptContext) {
              throw new UnsupportedOperationException("Not implemented.");
            }
          });
  List<InputSplit> splits = export.getSplits(null);
  UnshardedInputSplit fooSplit = (UnshardedInputSplit) splits.get(0);
  assertThat(fooSplit.getPath().getName()).isEqualTo("Foo");
  UnshardedInputSplit barSplit = (UnshardedInputSplit) splits.get(1);
  assertThat(barSplit.getPath().getName()).isEqualTo("Bar");
}