### Question:
WikipediaIngestHelper extends ExtendedContentIngestHelper implements TermFrequencyIngestHelperInterface, IndexOnlyIngestHelperInterface { @Override public Multimap<String,NormalizedContentInterface> getEventFields(RawRecordContainer event) { HashMultimap<String,String> fields = HashMultimap.create(); String data = new String(event.getRawData()); StringReader reader = new StringReader(data); InputSource source = new InputSource(reader); try { WikipediaContentHandler handler = new WikipediaContentHandler(fields, ignoreFields); XMLReader parser = XMLReaderFactory.createXMLReader(); parser.setFeature("http: parser.setFeature("http: parser.setFeature("http: parser.setContentHandler(handler); parser.parse(source); } catch (Exception e) { log.error("Error processing Wikipedia XML document", e); event.addError(RawDataErrorNames.FIELD_EXTRACTION_ERROR); } extractWikipediaTypeInformation(event, fields); return normalize(fields); }  WikipediaHelper getDataTypeHelper(); @Override void setup(Configuration config); @Override Multimap<String,NormalizedContentInterface> getEventFields(RawRecordContainer event); Set<NormalizedContentInterface> normalize(NormalizedContentInterface field); @Override Set<String> getIndexOnlyFields(); @Override boolean isTermFrequencyField(String fieldName); static final Map<String,String> fieldNameReplacements; }### Answer:
@Test public void testRawEquivalence() throws Exception { WikipediaRecordReader reader = new WikipediaRecordReader(); reader.initialize(split, ctx); reader.setInputDate(System.currentTimeMillis()); Assert.assertTrue(reader.nextKeyValue()); RawRecordContainer e = reader.getEvent(); Multimap<String,NormalizedContentInterface> eventFields = ingestHelper.getEventFields(e); assertRawFieldsEquivalence(eventFields, this.expectedRawFieldsRecord1); Assert.assertTrue(reader.nextKeyValue()); e = reader.getEvent(); eventFields = ingestHelper.getEventFields(e); assertRawFieldsEquivalence(eventFields, this.expectedRawFieldsRecord2); }
@Test public void testNormalizedEquivalence() throws Exception { WikipediaRecordReader reader = new WikipediaRecordReader(); reader.initialize(split, ctx); reader.setInputDate(System.currentTimeMillis()); Assert.assertTrue(reader.nextKeyValue()); RawRecordContainer e = reader.getEvent(); Assert.assertEquals("enwiki", e.getDataType().outputName()); Multimap<String,NormalizedContentInterface> eventFields = ingestHelper.getEventFields(e); assertNormalizedFieldsEquivalence(eventFields, this.expectedNormalizedFieldsRecord1); Assert.assertTrue(reader.nextKeyValue()); e = reader.getEvent(); eventFields = ingestHelper.getEventFields(e); assertNormalizedFieldsEquivalence(eventFields, this.expectedNormalizedFieldsRecord2); }