@Test void noNewThemes() throws GetThemeException { bootstrapThemePopulator.populate(); verify(styleService, never()).addStyle(any(), any(), any(), any(), any()); }
public void populate() { PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); try { Resource[] bootstrap3Themes = resolver.getResources(LOCAL_CSS_BOOTSTRAP_3_THEME_LOCATION); Resource[] bootstrap4Themes = resolver.getResources(LOCAL_CSS_BOOTSTRAP_4_THEME_LOCATION); List<Resource> newThemes = Arrays.stream(bootstrap3Themes) .filter( theme -> dataService.getRepository(STYLE_SHEET).findOneById(theme.getFilename()) == null) .collect(Collectors.toList()); newThemes.forEach(nt -> addNewTheme(nt, bootstrap4Themes)); } catch (Exception e) { LOG.error("error populating bootstrap themes", e); } }
BootstrapThemePopulator { public void populate() { PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); try { Resource[] bootstrap3Themes = resolver.getResources(LOCAL_CSS_BOOTSTRAP_3_THEME_LOCATION); Resource[] bootstrap4Themes = resolver.getResources(LOCAL_CSS_BOOTSTRAP_4_THEME_LOCATION); List<Resource> newThemes = Arrays.stream(bootstrap3Themes) .filter( theme -> dataService.getRepository(STYLE_SHEET).findOneById(theme.getFilename()) == null) .collect(Collectors.toList()); newThemes.forEach(nt -> addNewTheme(nt, bootstrap4Themes)); } catch (Exception e) { LOG.error("error populating bootstrap themes", e); } } }
BootstrapThemePopulator { public void populate() { PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); try { Resource[] bootstrap3Themes = resolver.getResources(LOCAL_CSS_BOOTSTRAP_3_THEME_LOCATION); Resource[] bootstrap4Themes = resolver.getResources(LOCAL_CSS_BOOTSTRAP_4_THEME_LOCATION); List<Resource> newThemes = Arrays.stream(bootstrap3Themes) .filter( theme -> dataService.getRepository(STYLE_SHEET).findOneById(theme.getFilename()) == null) .collect(Collectors.toList()); newThemes.forEach(nt -> addNewTheme(nt, bootstrap4Themes)); } catch (Exception e) { LOG.error("error populating bootstrap themes", e); } } BootstrapThemePopulator(StyleService styleService, DataService dataService); }
BootstrapThemePopulator { public void populate() { PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); try { Resource[] bootstrap3Themes = resolver.getResources(LOCAL_CSS_BOOTSTRAP_3_THEME_LOCATION); Resource[] bootstrap4Themes = resolver.getResources(LOCAL_CSS_BOOTSTRAP_4_THEME_LOCATION); List<Resource> newThemes = Arrays.stream(bootstrap3Themes) .filter( theme -> dataService.getRepository(STYLE_SHEET).findOneById(theme.getFilename()) == null) .collect(Collectors.toList()); newThemes.forEach(nt -> addNewTheme(nt, bootstrap4Themes)); } catch (Exception e) { LOG.error("error populating bootstrap themes", e); } } BootstrapThemePopulator(StyleService styleService, DataService dataService); void populate(); }
BootstrapThemePopulator { public void populate() { PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); try { Resource[] bootstrap3Themes = resolver.getResources(LOCAL_CSS_BOOTSTRAP_3_THEME_LOCATION); Resource[] bootstrap4Themes = resolver.getResources(LOCAL_CSS_BOOTSTRAP_4_THEME_LOCATION); List<Resource> newThemes = Arrays.stream(bootstrap3Themes) .filter( theme -> dataService.getRepository(STYLE_SHEET).findOneById(theme.getFilename()) == null) .collect(Collectors.toList()); newThemes.forEach(nt -> addNewTheme(nt, bootstrap4Themes)); } catch (Exception e) { LOG.error("error populating bootstrap themes", e); } } BootstrapThemePopulator(StyleService styleService, DataService dataService); void populate();  }