@Test public void assertLoaded () { verify(scriptManager, times(1)).populateScriptsFromResources(); }
@PostConstruct void populateScriptsFromResources () { scripts.addAll(Arrays.stream(getResources()).filter(not(Resource::isFile).or(this::allowScriptsFromFilesystem)) .map(ShellScript::fromResource) .collect(Collectors.toList())); }
ScriptManager { @PostConstruct void populateScriptsFromResources () { scripts.addAll(Arrays.stream(getResources()).filter(not(Resource::isFile).or(this::allowScriptsFromFilesystem)) .map(ShellScript::fromResource) .collect(Collectors.toList())); } }
ScriptManager { @PostConstruct void populateScriptsFromResources () { scripts.addAll(Arrays.stream(getResources()).filter(not(Resource::isFile).or(this::allowScriptsFromFilesystem)) .map(ShellScript::fromResource) .collect(Collectors.toList())); } ScriptManager(@Value("${allowScriptsFromFilesystem:false}") boolean allowScriptsFromFilesystem); }
ScriptManager { @PostConstruct void populateScriptsFromResources () { scripts.addAll(Arrays.stream(getResources()).filter(not(Resource::isFile).or(this::allowScriptsFromFilesystem)) .map(ShellScript::fromResource) .collect(Collectors.toList())); } ScriptManager(@Value("${allowScriptsFromFilesystem:false}") boolean allowScriptsFromFilesystem); Collection<Script> getScripts(); Collection<Script> getScripts(Predicate<? super Script> predicate); }
ScriptManager { @PostConstruct void populateScriptsFromResources () { scripts.addAll(Arrays.stream(getResources()).filter(not(Resource::isFile).or(this::allowScriptsFromFilesystem)) .map(ShellScript::fromResource) .collect(Collectors.toList())); } ScriptManager(@Value("${allowScriptsFromFilesystem:false}") boolean allowScriptsFromFilesystem); Collection<Script> getScripts(); Collection<Script> getScripts(Predicate<? super Script> predicate);  }