Search in sources :

Example 1 with KeycloakTokenResponse

use of org.eclipse.che.multiuser.keycloak.shared.dto.KeycloakTokenResponse in project che-server by eclipse-che.

the class KeycloakServiceClientTest method shouldReturnToken.

@Test
public void shouldReturnToken() throws Exception {
    String tokenType = "test_type";
    keycloakService = new KeycloakService(token, scope, tokenType, null);
    KeycloakTokenResponse response = keycloakServiceClient.getIdentityProviderToken("github");
    assertNotNull(response);
    assertEquals(response.getAccessToken(), token);
    assertEquals(response.getScope(), scope);
    assertEquals(response.getTokenType(), tokenType);
}
Also used : KeycloakTokenResponse(org.eclipse.che.multiuser.keycloak.shared.dto.KeycloakTokenResponse) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Test(org.testng.annotations.Test)

Example 2 with KeycloakTokenResponse

use of org.eclipse.che.multiuser.keycloak.shared.dto.KeycloakTokenResponse in project devspaces-images by redhat-developer.

the class KeycloakServiceClientTest method shouldReturnToken.

@Test
public void shouldReturnToken() throws Exception {
    String tokenType = "test_type";
    keycloakService = new KeycloakService(token, scope, tokenType, null);
    KeycloakTokenResponse response = keycloakServiceClient.getIdentityProviderToken("github");
    assertNotNull(response);
    assertEquals(response.getAccessToken(), token);
    assertEquals(response.getScope(), scope);
    assertEquals(response.getTokenType(), tokenType);
}
Also used : KeycloakTokenResponse(org.eclipse.che.multiuser.keycloak.shared.dto.KeycloakTokenResponse) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Test(org.testng.annotations.Test)

Aggregations

KeycloakTokenResponse (org.eclipse.che.multiuser.keycloak.shared.dto.KeycloakTokenResponse)2 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)2 Test (org.testng.annotations.Test)2