Search in sources :

Example 1 with AdminOpenIdAuthenticationManager

use of alfio.manager.openid.AdminOpenIdAuthenticationManager in project alf.io by alfio-event.

the class AdminOpenIdAuthenticationManagerTest method setUp.

@BeforeEach
void setUp() {
    environment = mock(Environment.class);
    when(environment.getProperty(eq("openid.domain"))).thenReturn(DOMAIN);
    when(environment.getProperty(eq("openid.clientId"))).thenReturn(CLIENT_ID);
    when(environment.getProperty(eq("openid.clientSecret"))).thenReturn(CLIENT_SECRET);
    when(environment.getProperty(eq("openid.callbackURI"), anyString())).thenReturn(CALLBACK_URI);
    when(environment.getProperty(eq("openid.authenticationUrl"))).thenReturn(AUTHENTICATION_URL);
    when(environment.getProperty(eq("openid.tokenEndpoint"), anyString())).thenReturn(CLAIMS_URI);
    when(environment.getProperty(eq("openid.contentType"), anyString())).thenReturn(CONTENT_TYPE);
    when(environment.getProperty(eq("openid.rolesParameter"))).thenReturn(GROUPS_NAME);
    when(environment.getProperty(eq("openid.alfioGroupsParameter"))).thenReturn(ALFIO_GROUPS_NAME);
    when(environment.getProperty(eq("openid.logoutUrl"))).thenReturn(LOGOUT_URL);
    when(environment.getProperty(eq("openid.logoutRedirectUrl"), anyString())).thenReturn(LOGOUT_REDIRECT_URL);
    var configurationManager = mock(ConfigurationManager.class);
    when(configurationManager.getFor(eq(ConfigurationKeys.BASE_URL), any())).thenReturn(new ConfigurationManager.MaybeConfiguration(ConfigurationKeys.BASE_URL, new ConfigurationKeyValuePathLevel("", "blabla", ConfigurationPathLevel.SYSTEM)));
    authenticationManager = new AdminOpenIdAuthenticationManager(environment, null, configurationManager, null, null, null, null, null, null, null, new Json());
}
Also used : AdminOpenIdAuthenticationManager(alfio.manager.openid.AdminOpenIdAuthenticationManager) Environment(org.springframework.core.env.Environment) Json(alfio.util.Json) ConfigurationManager(alfio.manager.system.ConfigurationManager) ConfigurationKeyValuePathLevel(alfio.model.system.ConfigurationKeyValuePathLevel) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

AdminOpenIdAuthenticationManager (alfio.manager.openid.AdminOpenIdAuthenticationManager)1 ConfigurationManager (alfio.manager.system.ConfigurationManager)1 ConfigurationKeyValuePathLevel (alfio.model.system.ConfigurationKeyValuePathLevel)1 Json (alfio.util.Json)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 Environment (org.springframework.core.env.Environment)1