MetadataImporter extends Mapper<AvroKey<DocumentText>, NullWritable, NullWritable, NullWritable> { @Override public void cleanup(Context context) throws IOException, InterruptedException { log.debug("cleanup: closing multiple outputs..."); mos.close(); log.debug("cleanup: multiple outputs closed"); }  @Override void cleanup(Context context); static final String NAMED_OUTPUT_META; static final String NAMED_OUTPUT_FAULT; static final String EXCLUDED_IDS; static final String FAULT_TEXT; static final String PARAM_INGEST_METADATA_OAI_NAMESPACE; }
@Test public void testCleanup() throws Exception { Configuration conf = new Configuration(); conf.set(NAMED_OUTPUT_META, "meta"); conf.set(NAMED_OUTPUT_FAULT, "fault"); conf.set(NAMED_OUTPUT_FAULT, "fault"); doReturn(conf).when(context).getConfiguration(); mapper.setup(context); mapper.cleanup(context); verify(multipleOutputs, times(1)).close(); }