DocumentContentUrlDispatcher extends Mapper<AvroKey<DocumentContentUrl>, NullWritable, NullWritable, NullWritable> { @Override public void cleanup(Context context) throws IOException, InterruptedException { mos.close(); }  @Override void cleanup(Context context); @Override void map(AvroKey<DocumentContentUrl> key, NullWritable ignore, Context context);  }
@Test public void testCleanup() throws Exception { String outputNamePdf = "pdf"; Configuration conf = new Configuration(); conf.set(PROPERTY_MULTIPLEOUTPUTS, buildMultipleOutputsProperty(outputNamePdf)); doReturn(conf).when(context).getConfiguration(); dispatcher.setup(context); dispatcher.cleanup(context); verify(multipleOutputs, times(1)).close(); }