Event#clientId is already Client#clientIdand notClient#id, fix #23 (#24)

This commit is contained in:
Stephan Schnabel 2023-04-24 14:20:22 +02:00 committed by GitHub
parent 456f903159
commit 181fcd6d38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 28 deletions

View file

@ -2,6 +2,7 @@ package io.kokuwa.keycloak.metrics.junit;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.ws.rs.NotAuthorizedException;
import javax.ws.rs.core.MultivaluedHashMap;
@ -31,6 +32,7 @@ public class KeycloakClient {
public void createRealm(String realmName) {
var realm = new RealmRepresentation();
realm.setId(UUID.randomUUID().toString());
realm.setEnabled(true);
realm.setRealm(realmName);
realm.setEventsListeners(List.of("metrics-listener"));
@ -39,6 +41,7 @@ public class KeycloakClient {
public void createClient(String realmName, String clientId) {
var client = new ClientRepresentation();
client.setId(UUID.randomUUID().toString());
client.setClientId(clientId);
client.setPublicClient(true);
client.setDirectAccessGrantsEnabled(true);