### Question:
TableInputStepAnalyzer extends ConnectionExternalResourceStepAnalyzer<TableInputMeta> { @Override protected IMetaverseNode createTableNode( IExternalResourceInfo resource ) throws MetaverseAnalyzerException { BaseDatabaseResourceInfo resourceInfo = (BaseDatabaseResourceInfo) resource; Object obj = resourceInfo.getAttributes().get( DictionaryConst.PROPERTY_QUERY ); String query = obj == null ? null : obj.toString(); MetaverseComponentDescriptor componentDescriptor = new MetaverseComponentDescriptor( "SQL", DictionaryConst.NODE_TYPE_SQL_QUERY, getConnectionNode(), getDescriptor().getContext() ); IMetaverseNode tableNode = createNodeFromDescriptor( componentDescriptor ); tableNode.setProperty( DictionaryConst.PROPERTY_NAMESPACE, componentDescriptor.getNamespace().getNamespaceId() ); tableNode.setProperty( DictionaryConst.PROPERTY_QUERY, query ); tableNode.setLogicalIdGenerator( DictionaryConst.LOGICAL_ID_GENERATOR_DB_QUERY ); return tableNode; }  @Override Set<Class<? extends BaseStepMeta>> getSupportedSteps(); @Override String getResourceInputNodeType(); @Override String getResourceOutputNodeType(); @Override boolean isOutput(); @Override boolean isInput(); @Override IMetaverseNode getConnectionNode(); void setBaseStepMeta( TableInputMeta meta ); @Override String toString();  }### Answer:
@Test public void testCreateTableNode() throws Exception { BaseDatabaseResourceInfo resourceInfo = mock( BaseDatabaseResourceInfo.class ); Map<Object, Object> attributes = new HashMap<>(); attributes.put( DictionaryConst.PROPERTY_QUERY, "select * from mytable" ); when( resourceInfo.getAttributes() ).thenReturn( attributes ); IMetaverseNode connectionNode = mock( IMetaverseNode.class ); doReturn( connectionNode ).when( analyzer ).getConnectionNode(); when( connectionNode.getLogicalId() ).thenReturn( "CONNECTION_ID" ); IMetaverseNode resourceNode = analyzer.createTableNode( resourceInfo ); assertEquals( "select * from mytable", resourceNode.getProperty( DictionaryConst.PROPERTY_QUERY ) ); assertEquals( "SQL", resourceNode.getName() ); assertEquals( "CONNECTION_ID", resourceNode.getProperty( DictionaryConst.PROPERTY_NAMESPACE ) ); }