HadoopFileInputMeta extends TextFileInputMeta implements HadoopFileMeta { @Override protected String loadSourceRep( Repository rep, ObjectId id_step, int i, IMetaStore metaStore ) throws KettleException { String source_filefolder = rep.getStepAttributeString( id_step, i, "file_name" ); String ncName = rep.getJobEntryAttributeString( id_step, i, SOURCE_CONFIGURATION_NAME ); return loadUrl( encryptDecryptPassword( source_filefolder, EncryptDirection.DECRYPT ), ncName, metaStore, namedClusterURLMapping ); } HadoopFileInputMeta();  HadoopFileInputMeta( NamedClusterService namedClusterService ); String loadUrl( String url, String ncName, IMetaStore metastore, Map<String, String> mappings ); void setNamedClusterURLMapping( Map<String, String> mappings ); Map<String, String> getNamedClusterURLMapping(); @Override String getClusterName( final String url ); String getClusterNameBy( String url ); String getUrlPath( String incomingURL ); void setVariableSpace( VariableSpace variableSpace ); NamedClusterService getNamedClusterService(); @Override FileInputList getFileInputList( VariableSpace space ); static final String SOURCE_CONFIGURATION_NAME; static final String LOCAL_SOURCE_FILE; static final String STATIC_SOURCE_FILE; static final String S3_SOURCE_FILE; static final String S3_DEST_FILE; @Injection( name = "ENVIRONMENT", group = "FILENAME_LINES" )
  public String[] environment; }
@Test public void testLoadSourceRepForUrlRefresh() throws Exception { final String URL_FROM_CLUSTER = "urlFromCluster"; IMetaStore mockMetaStore = mock( IMetaStore.class ); NamedCluster mockNamedCluster = mock( NamedCluster.class ); when( mockNamedCluster.processURLsubstitution( any(), eq( mockMetaStore ), any() ) ).thenReturn( URL_FROM_CLUSTER ); when( namedClusterService.getNamedClusterByName( TEST_CLUSTER_NAME, mockMetaStore ) ).thenReturn( mockNamedCluster ); Repository mockRep = mock( Repository.class ); when( mockRep.getJobEntryAttributeString( anyObject(), eq( 0 ), eq( "source_configuration_name" ) ) ).thenReturn( TEST_CLUSTER_NAME ); HadoopFileInputMeta hadoopFileInputMeta = new HadoopFileInputMeta( namedClusterService ); when( mockRep.getStepAttributeString( anyObject(), eq( 0 ), eq( "file_name" ) ) ).thenReturn( URL_FROM_CLUSTER ); assertEquals( URL_FROM_CLUSTER, hadoopFileInputMeta.loadSourceRep( mockRep, null, 0, mockMetaStore ) ); }