Configuration { public void setAuthorizer(String authorizer) { if (authorizer != null) { if (authorizer.isEmpty()) { throw new IllegalArgumentException("Authorizer class name cannot be empty."); } if (!FULLY_QUALIFIED_CLASS_NAME_PATTERN.matcher(authorizer).matches()) { throw new IllegalArgumentException("Authorizer class name '" + authorizer + "' is not a fully qualified Java class name."); } } this.authorizer = authorizer; } Configuration(); Optional<String> getContextPath(); void setContextPath(String contextPath); Optional<String> getThemeName(); void setThemeName(String themeName); Optional<String> getLoginPageUri(); void setLoginPageUri(String loginPageUri); Optional<String> getAuthorizer(); void setAuthorizer(String authorizer); Optional<String> getSessionManagerFactoryClassName(); void setSessionManagerFactoryClassName(String factoryClassName); long getSessionTimeout(); void setSessionTimeout(long sessionTimeout); Optional<String> getErrorPageUri(int httpStatusCode); void setErrorPageUris(Map<Integer, String> errorPageUris); Optional<String> getDefaultErrorPageUri(); void setDefaultErrorPageUri(String defaultErrorPageUri); List<MenuItem> getMenu(String name); void setMenus(List<? extends Menu> menus); Set<UriPatten> getCsrfIgnoreUris(); void setCsrfIgnoreUris(Set<String> csrfIgnoreUris); Set<UriPatten> getXssIgnoreUris(); void setXssIgnoreUris(Set<String> xssIgnoreUris); ResponseHeaders getResponseHeaders(); void setResponseHeaders(ResponseHeaders responseHeaders); Map<String, Object> other(); void setOther(Map<String, Object> other);  }
@Test public void testAuthorizerValidations() { Configuration configuration = createConfiguration(); Assert.assertThrows(IllegalArgumentException.class, () -> configuration.setAuthorizer("")); Assert.assertThrows(IllegalArgumentException.class, () -> configuration.setAuthorizer("c/lass")); Assert.assertThrows(IllegalArgumentException.class, () -> configuration.setAuthorizer("c*lass")); configuration.setAuthorizer(null); configuration.setAuthorizer("CaasAuthorizer"); configuration.setAuthorizer("org.wso2.carbon.uuf.sample.simpleauth.bundle.api.auth." + "CaasAuthorizer"); }