TenantContextThemeResolver extends AbstractThemeResolver { @Override public String resolveThemeName(HttpServletRequest request) { String tenant = TenantContextHolder.getContext().getTenant(); if (StringUtils.hasText(tenant)) { return this.prefix + tenant + this.suffix; } return getDefaultThemeName(); }  @Override String resolveThemeName(HttpServletRequest request); @Override void setThemeName(HttpServletRequest request, HttpServletResponse response, String themeName); void setPrefix(String prefix); void setSuffix(String suffix);  }
@Test public void whenNoContextSetReturnTheDefaultTheme() { String theme = this.resolver.resolveThemeName(null); assertThat(theme, is("theme")); }
@Test public void whenContextSetReturnThatContextAsTheme() { TenantContextTestUtil.setCurrentTenant("test-theme"); String theme = this.resolver.resolveThemeName(null); assertThat(theme, is("test-theme")); }