@Test
public void testCreateWriter() throws EventDeliveryException {

  config.put(DatasetSinkConstants.CONFIG_FLUSHABLE_COMMIT_ON_BATCH,
      Boolean.toString(false));
  config.put(DatasetSinkConstants.CONFIG_SYNCABLE_SYNC_ON_BATCH,
      Boolean.toString(false));
  DatasetSink sink = sink(in, config);
  // run the sink
  sink.start();
  sink.process();
  sink.commitTransaction();
  sink.createWriter();
  Assert.assertNotNull("Writer should not be null", sink.getWriter());
  Assert.assertEquals("Should have committed", 0, remaining(in));
  sink.stop();
  Assert.assertEquals(0, read(Datasets.load(FILE_DATASET_URI)).size());
}