Search in sources :

Example 1 with DefaultKeycloakServiceClient

use of org.jboss.pnc.auth.DefaultKeycloakServiceClient in project pnc by project-ncl.

the class KeycloakServiceClientTest method shouldObtainAuthToken.

@Test
public void shouldObtainAuthToken() throws ConfigurationParseException, IOException {
    SystemConfig systemConfig = SystemConfigMock.withKeycloakServiceAccount();
    KeycloakServiceClient keycloakServiceClient = new DefaultKeycloakServiceClient(systemConfig);
    String authToken = keycloakServiceClient.getAuthToken();
    Assertions.assertThat(authToken).isNotEmpty();
}
Also used : SystemConfig(org.jboss.pnc.common.json.moduleconfig.SystemConfig) DefaultKeycloakServiceClient(org.jboss.pnc.auth.DefaultKeycloakServiceClient) DefaultKeycloakServiceClient(org.jboss.pnc.auth.DefaultKeycloakServiceClient) KeycloakServiceClient(org.jboss.pnc.auth.KeycloakServiceClient) DebugTest(org.jboss.pnc.test.category.DebugTest) Test(org.junit.Test)

Aggregations

DefaultKeycloakServiceClient (org.jboss.pnc.auth.DefaultKeycloakServiceClient)1 KeycloakServiceClient (org.jboss.pnc.auth.KeycloakServiceClient)1 SystemConfig (org.jboss.pnc.common.json.moduleconfig.SystemConfig)1 DebugTest (org.jboss.pnc.test.category.DebugTest)1 Test (org.junit.Test)1