DefaultOAuth2Config implements OAuth2Config, OAuth2Configurator, AppInitializable, AppListener { @Override public void onServerInfoResolved(App app, ServerInfo serverInfo) { this.authorizeUrl = parseUrl(this.authorizeUrl,serverInfo); this.tokenUrl = parseUrl(this.tokenUrl,serverInfo); this.tokenInfoUrl = parseUrl(this.tokenInfoUrl,serverInfo); this.userInfoUrl = parseUrl(this.userInfoUrl,serverInfo); this.publicKeyUrl = parseUrl(this.publicKeyUrl,serverInfo); this.logoutUrl = parseUrl(this.logoutUrl,serverInfo); }  @Override OAuth2Config config(); @Override boolean isEnabled(); @Override @ConfigProperty OAuth2Configurator setEnabled(boolean enabled); @Override boolean isLogin(); @ConfigProperty void setLogin(boolean login); @Override boolean isLogout(); @ConfigProperty void setLogout(boolean logout); @Override boolean isLoginWithAccessToken(); @ConfigProperty void setLoginWithAccessToken(boolean loginWithAccessToken); @Override boolean isForceLookupUserInfo(); @ConfigProperty void setForceLookupUserInfo(boolean forceLookupUserInfo); @Override @ConfigProperty OAuth2Configurator setServerUrl(String serverUrl); @ConfigProperty void setIndirectServerUrl(String indirectServerUrl); @ConfigProperty void setDirectServerUrl(String directServerUrl); @Override void onServerInfoResolved(App app, ServerInfo serverInfo); @Override String getAuthorizeUrl(); @Override @ConfigProperty OAuth2Configurator setAuthorizeUrl(String url); @Override String getTokenUrl(); @Override String getIndirectTokenUrl(); @Override @ConfigProperty OAuth2Configurator setIndirectTokenUrl(String indirectTokenUrl); @Override @ConfigProperty OAuth2Configurator setTokenUrl(String url); @Override String getTokenInfoUrl(); @Override @ConfigProperty OAuth2Configurator setTokenInfoUrl(String url); @Override String getUserInfoUrl(); @Override @ConfigProperty OAuth2Configurator setUserInfoUrl(String url); @Override String getPublicKeyUrl(); @Override @ConfigProperty OAuth2Configurator setPublicKeyUrl(String url); @Override String getJwksUrl(); void setJwksUrl(String jwksUrl); @Override String getLogoutUrl(); @ConfigProperty void setLogoutUrl(String logoutUrl); @Override String getClientId(); @Override OAuth2Configurator ignorePath(String path); @Override RequestIgnore[] getIgnores(); @Override @ConfigProperty OAuth2Configurator setClientId(String clientId); @Override String getClientSecret(); @Override @ConfigProperty OAuth2Configurator setClientSecret(String clientSecret); @Override String getRedirectUri(); @ConfigProperty void setRedirectUri(String redirectUri); @Override String getErrorView(); @ConfigProperty void setErrorView(String errorView); @Override String getLogoutView(); @ConfigProperty void setLogoutView(String logoutView); @Override void postAppInit(App app);  }
@Test public void testOnServerInfoResolved(){ ServerInfo serverInfo = new ServerInfo(); serverInfo.setScheme("https"); serverInfo.setHost("127.0.0.1"); serverInfo.setPort(8080); serverInfo.setContextPath("/"); DefaultOAuth2Config config = (DefaultOAuth2Config)oc; config.setServerUrl("/"); config.setAuthorizeUrl("@{~/oauth2/authorize}"); config.setLogoutUrl("@{/}indirect/oauth2/authorize"); config.onServerInfoResolved(app,serverInfo); assertEquals("https: assertEquals("https: assertEquals("https: assertEquals("https: assertEquals("https: }