HadoopFileOutputMeta extends TextFileOutputMeta implements HadoopFileMeta { protected String getProcessedUrl( IMetaStore metastore, String url ) { if ( url == null ) { return null; } if ( metastore == null ) { try { metaStore = MetaStoreConst.openLocalPentahoMetaStore( false ); } catch ( Exception e ) { } } else { metaStore = metastore; } NamedCluster c = getNamedCluster(); if ( c != null ) { url = c.processURLsubstitution( url, metaStore, new Variables() ); } return url; } HadoopFileOutputMeta( NamedClusterService namedClusterService,
                               RuntimeTestActionService runtimeTestActionService, RuntimeTester runtimeTester ); @Override void setDefault(); String getSourceConfigurationName(); void setSourceConfigurationName( String ncName ); @Override String getClusterName( final String url ); NamedCluster getNamedCluster(); String getUrlPath( String incomingURL ); @Override String getXML(); NamedClusterService getNamedClusterService(); RuntimeTester getRuntimeTester(); RuntimeTestActionService getRuntimeTestActionService(); @Override String exportResources( VariableSpace space, Map<String, org.pentaho.di.resource.ResourceDefinition>
          definitions, ResourceNamingInterface resourceNamingInterface, Repository repository, IMetaStore metaStore );  }
@Test public void testProcessedUrlUsingEmbeddedCluster() throws Exception { String sourceConfigurationName = "scName"; String desiredUrl = "desiredUrl"; String url = "url"; HadoopFileOutputMeta hadoopFileOutputMeta = new HadoopFileOutputMeta( namedClusterService, runtimeTestActionService, runtimeTester ); NamedCluster nc = mock( NamedCluster.class ); NamedCluster nc2 = mock( NamedCluster.class ); MetaStoreConst.disableMetaStore = true; when( namedClusterService.getClusterTemplate() ).thenReturn( nc ); when( nc.fromXmlForEmbed( any() ) ).thenReturn( nc2 ); when( nc2.processURLsubstitution( eq( url ), any(), any() ) ).thenReturn( desiredUrl ); assertEquals( desiredUrl, hadoopFileOutputMeta.getProcessedUrl( null, url ) ); }