@Test public void getWebappInfoBasic() { WebappInfo wInfo0 = new WebappInfo.Builder() .server("foo").position("7").mountPoint("/bar/*").create(); wInfos.add(wInfo0); WebappInfo wInfo1 = new WebappInfo.Builder() .server("foo").position("14").mountPoint("/bar/baz/*").create(); wInfos.add(wInfo1); assertThat(wac.getWebappInfo("foo", "bar").get(), is(wInfo0)); assertThat(wac.getWebappInfo("foo", "barbaz").get(), is(wInfo1)); assertFalse(wac.getWebappInfo("foo", "bazbaz").isPresent()); }
public Optional<WebappInfo> getWebappInfo(String serverName, String webAppName) { return getAppBarWebInfos(serverName).stream() .filter(app -> app.getMountPoint().replaceAll("[/*]", "").equals(webAppName)) .findFirst(); }
WebAppCache { public Optional<WebappInfo> getWebappInfo(String serverName, String webAppName) { return getAppBarWebInfos(serverName).stream() .filter(app -> app.getMountPoint().replaceAll("[/*]", "").equals(webAppName)) .findFirst(); } }
WebAppCache { public Optional<WebappInfo> getWebappInfo(String serverName, String webAppName) { return getAppBarWebInfos(serverName).stream() .filter(app -> app.getMountPoint().replaceAll("[/*]", "").equals(webAppName)) .findFirst(); } WebAppCache(Supplier<Collection<ComponentConfig>> supplier); }
WebAppCache { public Optional<WebappInfo> getWebappInfo(String serverName, String webAppName) { return getAppBarWebInfos(serverName).stream() .filter(app -> app.getMountPoint().replaceAll("[/*]", "").equals(webAppName)) .findFirst(); } WebAppCache(Supplier<Collection<ComponentConfig>> supplier); List<WebappInfo> getAppBarWebInfos(String serverName); List<WebappInfo> getAppBarWebInfos(String serverName, String menuName); Optional<WebappInfo> getWebappInfo(String serverName, String webAppName); static WebAppCache getShared(); }
WebAppCache { public Optional<WebappInfo> getWebappInfo(String serverName, String webAppName) { return getAppBarWebInfos(serverName).stream() .filter(app -> app.getMountPoint().replaceAll("[/*]", "").equals(webAppName)) .findFirst(); } WebAppCache(Supplier<Collection<ComponentConfig>> supplier); List<WebappInfo> getAppBarWebInfos(String serverName); List<WebappInfo> getAppBarWebInfos(String serverName, String menuName); Optional<WebappInfo> getWebappInfo(String serverName, String webAppName); static WebAppCache getShared();  }