### Question:
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);  }### Answer:
@Test public void testGetScripts() { Credential credential = Credential.builder().crn("crn0").build(); AdlsFileSystemConfigurationsView adlsFileSystemConfigurationsView = new AdlsFileSystemConfigurationsView(adlsFileSystem(), new HashSet<>(), false); List<RecipeScript> actual = underTest.getScripts(credential, adlsFileSystemConfigurationsView); List<RecipeScript> expected = singletonList(new RecipeScript("echo 'newContent'", ExecutionType.ALL_NODES, RecipeType.POST_CLOUDERA_MANAGER_START)); Assert.assertEquals(expected, actual); }
@Test public void testGetScriptsWhenNoReplace() { Credential credential = Credential.builder().crn("crn1").build(); AdlsFileSystemConfigurationsView adlsFileSystemConfigurationsView = new AdlsFileSystemConfigurationsView(adlsFileSystem(), new HashSet<>(), false); List<RecipeScript> actual = underTest.getScripts(credential, adlsFileSystemConfigurationsView); List<RecipeScript> expected = singletonList(new RecipeScript("echo '$replace'", ExecutionType.ALL_NODES, RecipeType.POST_CLOUDERA_MANAGER_START)); Assert.assertEquals(expected, actual); }
@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); }