### Question:
MorphlineResultToSolrMapper implements ResultToSolrMapper, Configurable { @Override public void map(Result result, SolrUpdateWriter solrUpdateWriter) { localMorphlineMapper.get().map(result, solrUpdateWriter); } MorphlineResultToSolrMapper(); @Override void configure(Map<String, String> config); @Override boolean containsRequiredData(Result result); @Override boolean isRelevantKV(KeyValue kv); @Override Get getGet(byte[] row); @Override void map(Result result, SolrUpdateWriter solrUpdateWriter); static final String MORPHLINE_FILE_PARAM; static final String MORPHLINE_ID_PARAM; static final String MORPHLINE_VARIABLE_PARAM; static final String MORPHLINE_FIELD_PARAM; static final String OUTPUT_MIME_TYPE; }### Answer:
@Test public void testMap() throws Exception { MorphlineResultToSolrMapper resultMapper = new MorphlineResultToSolrMapper(); resultMapper.configure(ImmutableMap.of( MorphlineResultToSolrMapper.MORPHLINE_FILE_PARAM, "src/test/resources/test-morphlines/extractHBaseCells.conf") ); Cell kvA = new KeyValue(ROW, COLUMN_FAMILY_A, QUALIFIER_A, Bytes.toBytes(42)); Cell kvB = new KeyValue(ROW, COLUMN_FAMILY_B, QUALIFIER_B, "dummy value".getBytes("UTF-8")); Result result = Result.create(Lists.newArrayList(kvA, kvB)); Multimap expectedMap = ImmutableMultimap.of("fieldA", 42, "fieldB", "dummy value"); resultMapper.map(result, updateWriter); verify(updateWriter).add(solrInputDocCaptor.capture()); SolrInputDocument solrDocument = solrInputDocCaptor.getValue(); assertEquals(expectedMap, toRecord(solrDocument).getFields()); }