### Question:
MorphlineResultToSolrMapper implements ResultToSolrMapper, Configurable { @Override public boolean containsRequiredData(Result result) { return localMorphlineMapper.get().containsRequiredData(result); } 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 testContainsRequiredData_False() { FieldDefinition fieldDef = new FieldDefinition("fieldname", "cfA:quali*", ValueSource.VALUE, "int"); MorphlineResultToSolrMapper resultMapper = createMorphlineMapper(fieldDef); Result result = Result.create(Lists.newArrayList((Cell)new KeyValue(ROW, COLUMN_FAMILY_A, QUALIFIER_A, Bytes.toBytes("value")))); assertFalse(resultMapper.containsRequiredData(result)); }
@Test public void testContainsRequiredData_True() { FieldDefinition fieldDef = new FieldDefinition("fieldname", "cfA:qualifierA", ValueSource.VALUE, "int"); MorphlineResultToSolrMapper resultMapper = createMorphlineMapper(fieldDef); Result result = Result.create(Lists.newArrayList((Cell)new KeyValue(ROW, COLUMN_FAMILY_A, QUALIFIER_A, Bytes.toBytes("value")))); assertTrue(resultMapper.containsRequiredData(result)); }