@Test public void testGetScriptsWhenFileNotFound() { Credential credential = Credential.builder().crn("crn2").build(); AdlsFileSystemConfigurationsView adlsFileSystemConfigurationsView = new AdlsFileSystemConfigurationsView(adlsFileSystem(), new HashSet<>(), false); thrown.expectMessage("Filesystem configuration scripts cannot be read."); thrown.expect(FileSystemConfigException.class); underTest.getScripts(credential, adlsFileSystemConfigurationsView); }
@Override public List<RecipeScript> getScripts(Credential credential, T fsConfig) { List<RecipeScript> scripts = new ArrayList<>(); try { for (FileSystemScriptConfig fsScriptConfig : getScriptConfigs(credential)) { String script = FileReaderUtils.readFileFromClasspath(fsScriptConfig.getScriptLocation()); for (Entry<String, String> entry : fsScriptConfig.getProperties().entrySet()) { script = script.replaceAll("\\$" + entry.getKey(), entry.getValue()); } scripts.add(new RecipeScript(script, fsScriptConfig.getExecutionType(), fsScriptConfig.getRecipeType())); } } catch (IOException e) { throw new FileSystemConfigException("Filesystem configuration scripts cannot be read.", e); } return scripts; }
AbstractFileSystemConfigurator implements FileSystemConfigurator<T> { @Override public List<RecipeScript> getScripts(Credential credential, T fsConfig) { List<RecipeScript> scripts = new ArrayList<>(); try { for (FileSystemScriptConfig fsScriptConfig : getScriptConfigs(credential)) { String script = FileReaderUtils.readFileFromClasspath(fsScriptConfig.getScriptLocation()); for (Entry<String, String> entry : fsScriptConfig.getProperties().entrySet()) { script = script.replaceAll("\\$" + entry.getKey(), entry.getValue()); } scripts.add(new RecipeScript(script, fsScriptConfig.getExecutionType(), fsScriptConfig.getRecipeType())); } } catch (IOException e) { throw new FileSystemConfigException("Filesystem configuration scripts cannot be read.", e); } return scripts; } }
AbstractFileSystemConfigurator implements FileSystemConfigurator<T> { @Override public List<RecipeScript> getScripts(Credential credential, T fsConfig) { List<RecipeScript> scripts = new ArrayList<>(); try { for (FileSystemScriptConfig fsScriptConfig : getScriptConfigs(credential)) { String script = FileReaderUtils.readFileFromClasspath(fsScriptConfig.getScriptLocation()); for (Entry<String, String> entry : fsScriptConfig.getProperties().entrySet()) { script = script.replaceAll("\\$" + entry.getKey(), entry.getValue()); } scripts.add(new RecipeScript(script, fsScriptConfig.getExecutionType(), fsScriptConfig.getRecipeType())); } } catch (IOException e) { throw new FileSystemConfigException("Filesystem configuration scripts cannot be read.", e); } return scripts; }  }
AbstractFileSystemConfigurator implements FileSystemConfigurator<T> { @Override public List<RecipeScript> getScripts(Credential credential, T fsConfig) { List<RecipeScript> scripts = new ArrayList<>(); try { for (FileSystemScriptConfig fsScriptConfig : getScriptConfigs(credential)) { String script = FileReaderUtils.readFileFromClasspath(fsScriptConfig.getScriptLocation()); for (Entry<String, String> entry : fsScriptConfig.getProperties().entrySet()) { script = script.replaceAll("\\$" + entry.getKey(), entry.getValue()); } scripts.add(new RecipeScript(script, fsScriptConfig.getExecutionType(), fsScriptConfig.getRecipeType())); } } catch (IOException e) { throw new FileSystemConfigException("Filesystem configuration scripts cannot be read.", e); } return scripts; }  @Override List<RecipeScript> getScripts(Credential credential, T fsConfig); @Override Map<String, String> createResources(T fsConfig); @Override Map<String, String> deleteResources(T fsConfig); }
AbstractFileSystemConfigurator implements FileSystemConfigurator<T> { @Override public List<RecipeScript> getScripts(Credential credential, T fsConfig) { List<RecipeScript> scripts = new ArrayList<>(); try { for (FileSystemScriptConfig fsScriptConfig : getScriptConfigs(credential)) { String script = FileReaderUtils.readFileFromClasspath(fsScriptConfig.getScriptLocation()); for (Entry<String, String> entry : fsScriptConfig.getProperties().entrySet()) { script = script.replaceAll("\\$" + entry.getKey(), entry.getValue()); } scripts.add(new RecipeScript(script, fsScriptConfig.getExecutionType(), fsScriptConfig.getRecipeType())); } } catch (IOException e) { throw new FileSystemConfigException("Filesystem configuration scripts cannot be read.", e); } return scripts; }  @Override List<RecipeScript> getScripts(Credential credential, T fsConfig); @Override Map<String, String> createResources(T fsConfig); @Override Map<String, String> deleteResources(T fsConfig);  }