### Question:
MongoDbInputStepAnalyzer extends ConnectionExternalResourceStepAnalyzer<MongoDbInputMeta> { @Override protected void customAnalyze( MongoDbInputMeta meta, IMetaverseNode node ) throws MetaverseAnalyzerException { super.customAnalyze( meta, node ); node.setProperty( OUTPUT_JSON, meta.getOutputJson() ); node.setProperty( COLLECTION, meta.getCollection() ); if ( !meta.getOutputJson() ) { node.setProperty( DictionaryConst.PROPERTY_QUERY, meta.getJsonQuery() ); node.setProperty( AGG_PIPELINE, meta.getQueryIsPipeline() ); node.setProperty( DictionaryConst.PROPERTY_EXECUTE_EACH_ROW, meta.getExecuteForEachIncomingRow() ); node.setProperty( FIELDS_EXPRESSION, meta.getFieldsName() ); node.setProperty( READ_PREF, meta.getReadPreference() ); List<String> tagSets = meta.getReadPrefTagSets(); if ( tagSets != null ) { node.setProperty( TAG_SETS, tagSets.toString() ); } } }  @Override Set<Class<? extends BaseStepMeta>> getSupportedSteps(); @Override String getResourceInputNodeType(); @Override String getResourceOutputNodeType(); @Override boolean isOutput(); @Override boolean isInput(); @Override String toString(); static final String COLLECTION; static final String AGG_PIPELINE; static final String FIELDS_EXPRESSION; static final String READ_PREF; static final String TAG_SETS; static final String OUTPUT_JSON; static final String JSON_PATH; static final String MINMAX_RANGE; static final String OCCUR_RATIO; static final String INDEXED_VALS; static final String DISPARATE_TYPES; }### Answer:
@Test public void testCustomAnalyze() throws Exception { when( meta.getJsonQuery() ).thenReturn( "{test:test}" ); when( meta.getCollection() ).thenReturn( "myCollection" ); when( meta.getQueryIsPipeline() ).thenReturn( true ); IMetaverseNode node = new MetaverseTransientNode( "new node" ); analyzer.customAnalyze( meta, node ); assertNotNull( node ); assertEquals( "{test:test}", node.getProperty( DictionaryConst.PROPERTY_QUERY ) ); assertEquals( "myCollection", node.getProperty( MongoDbInputStepAnalyzer.COLLECTION ) ); assertTrue( (Boolean) node.getProperty( MongoDbInputStepAnalyzer.AGG_PIPELINE ) ); }
@Test public void testCustomAnalyze_jsonOutput() throws Exception { when( meta.getOutputJson() ).thenReturn( true ); when( meta.getCollection() ).thenReturn( "myCollection" ); IMetaverseNode node = new MetaverseTransientNode( "new node" ); analyzer.customAnalyze( meta, node ); assertNotNull( node ); assertEquals( "myCollection", node.getProperty( MongoDbInputStepAnalyzer.COLLECTION ) ); assertTrue( (Boolean) node.getProperty( MongoDbInputStepAnalyzer.OUTPUT_JSON ) ); assertNull( node.getProperty( DictionaryConst.PROPERTY_QUERY ) ); assertNull( node.getProperty( MongoDbInputStepAnalyzer.AGG_PIPELINE ) ); }