From e6d9c41f0b065f77e365137cd3023d77cb3c4655 Mon Sep 17 00:00:00 2001 From: Garth <244253+xgp@users.noreply.github.com> Date: Tue, 9 Apr 2024 22:18:09 +0200 Subject: [PATCH] formatting run --- .../auth/ActiveOrganizationAuthenticator.java | 42 +++++++-------- ...ctiveOrganizationAuthenticatorFactory.java | 16 +++--- .../KeycloakOrgsExportImportManager.java | 21 ++++---- .../mappers/ActiveOrganizationMapper.java | 6 +-- .../service/resource/MembersResource.java | 11 ++-- .../service/resource/UserResource.java | 4 +- .../service/util/ActiveOrganization.java | 12 ++--- .../AbstractCypressOrganizationTest.java | 53 +++++++------------ .../service/AbstractOrganizationTest.java | 21 ++------ .../service/CypressOrganizationTest.java | 44 ++++++++------- 10 files changed, 102 insertions(+), 128 deletions(-) diff --git a/src/main/java/io/phasetwo/service/auth/ActiveOrganizationAuthenticator.java b/src/main/java/io/phasetwo/service/auth/ActiveOrganizationAuthenticator.java index b22ee530..29c82dfb 100644 --- a/src/main/java/io/phasetwo/service/auth/ActiveOrganizationAuthenticator.java +++ b/src/main/java/io/phasetwo/service/auth/ActiveOrganizationAuthenticator.java @@ -29,18 +29,16 @@ public class ActiveOrganizationAuthenticator implements Authenticator { private static final String ERROR_FORM = "error.ftl"; public ActiveOrganizationAuthenticator(KeycloakSession session) { - this.provider = session.getProvider(OrganizationProvider.class); + this.provider = session.getProvider(OrganizationProvider.class); } @Override public void authenticate(AuthenticationFlowContext context) { if (requestHasAccountHintParam(context)) { evaluateAuthenticationWithAccountHint(context); - } - else if (shouldChallengeForOrganizationSelection(context)) { + } else if (shouldChallengeForOrganizationSelection(context)) { tryOrganizationSelectionChallenge(context); - } - else { + } else { context.success(); } } @@ -77,7 +75,8 @@ private String getOrganizationIdFromAccountHint(AuthenticationFlowContext contex } } - private void evaluateAuthenticationChallenge(AuthenticationFlowContext context, String organizationId) { + private void evaluateAuthenticationChallenge( + AuthenticationFlowContext context, String organizationId) { if (hasMembership(context, organizationId)) { updateActiveOrganizationAttributeAndSucceedChallenge(context, organizationId); } else { @@ -86,7 +85,8 @@ private void evaluateAuthenticationChallenge(AuthenticationFlowContext context, } private boolean hasMembership(AuthenticationFlowContext context, String organizationId) { - if (provider.getUserOrganizationsStream(context.getRealm(), context.getUser()) + if (provider + .getUserOrganizationsStream(context.getRealm(), context.getUser()) .noneMatch(org -> org.getId().equals(organizationId))) { log.errorf("User isn't a member of this organization"); return false; @@ -95,11 +95,10 @@ private boolean hasMembership(AuthenticationFlowContext context, String organiza } private void updateActiveOrganizationAttributeAndSucceedChallenge( - AuthenticationFlowContext context, - String organizationIdFromHint - ) { + AuthenticationFlowContext context, String organizationIdFromHint) { log.debugf("Authentication Challenge Success"); - context.getUser() + context + .getUser() .setAttribute(ACTIVE_ORGANIZATION, Collections.singletonList(organizationIdFromHint)); context.success(); } @@ -122,18 +121,17 @@ private boolean shouldChallengeForOrganizationSelection(AuthenticationFlowContex } private void tryOrganizationSelectionChallenge(AuthenticationFlowContext context) { - List organizations = provider - .getUserOrganizationsStream(context.getRealm(), context.getUser()).toList(); + List organizations = + provider.getUserOrganizationsStream(context.getRealm(), context.getUser()).toList(); if (organizations.isEmpty()) { - log.warnf("Select organization challenge couldn't be performed because the user has no organization."); + log.warnf( + "Select organization challenge couldn't be performed because the user has no organization."); failChallenge(context, "noOrganizationError"); - } - else if (organizations.size() == 1) { + } else if (organizations.size() == 1) { log.infof("User has 1 organization, skip organization selection challenge."); updateActiveOrganizationAttributeAndSucceedChallenge(context, organizations.get(0).getId()); - } - else { + } else { LoginFormsProvider loginForm = context.form(); loginForm.setAttribute("organizations", organizations); context.challenge(loginForm.createForm("select-organization.ftl")); @@ -160,14 +158,14 @@ public boolean requiresUser() { } @Override - public boolean configuredFor(KeycloakSession keycloakSession, RealmModel realmModel, - UserModel userModel) { + public boolean configuredFor( + KeycloakSession keycloakSession, RealmModel realmModel, UserModel userModel) { return true; } @Override - public void setRequiredActions(KeycloakSession keycloakSession, RealmModel realmModel, - UserModel userModel) {} + public void setRequiredActions( + KeycloakSession keycloakSession, RealmModel realmModel, UserModel userModel) {} @Override public void close() {} diff --git a/src/main/java/io/phasetwo/service/auth/ActiveOrganizationAuthenticatorFactory.java b/src/main/java/io/phasetwo/service/auth/ActiveOrganizationAuthenticatorFactory.java index e97b305f..ed4edcd1 100644 --- a/src/main/java/io/phasetwo/service/auth/ActiveOrganizationAuthenticatorFactory.java +++ b/src/main/java/io/phasetwo/service/auth/ActiveOrganizationAuthenticatorFactory.java @@ -39,8 +39,8 @@ public class ActiveOrganizationAuthenticatorFactory implements AuthenticatorFact public static final String PROVIDER_HELP_TEXT = "Select the current Organization on Login"; private static final AuthenticationExecutionModel.Requirement[] REQUIREMENT_CHOICES = { - AuthenticationExecutionModel.Requirement.REQUIRED, - AuthenticationExecutionModel.Requirement.DISABLED + AuthenticationExecutionModel.Requirement.REQUIRED, + AuthenticationExecutionModel.Requirement.DISABLED }; @Override @@ -101,12 +101,12 @@ public void postInit(KeycloakSessionFactory factory) { } else if (event instanceof PostMigrationEvent) { log.debug("PostMigrationEvent"); if (KC_ORGS_SKIP_MIGRATION == null) { - log.info("initializing active organization user profile attribute following migration"); + log.info( + "initializing active organization user profile attribute following migration"); KeycloakModelUtils.runJobInTransaction(factory, this::postMigrationCreateAuthFlow); } } - } - ); + }); } @Override @@ -121,8 +121,7 @@ private void postMigrationCreateAuthFlow(KeycloakSession session) { realm -> { createOrgBrowserFlow(realm); createOrgDirectGrantFlow(realm); - } - ); + }); } private void createOrgBrowserFlow(RealmModel realm) { @@ -285,7 +284,8 @@ private void conditionalOtp(String parentFlowId, RealmModel realm, String alias, conditionalOTP.setTopLevel(false); conditionalOTP.setBuiltIn(true); conditionalOTP.setAlias(alias); - conditionalOTP.setDescription("Flow to determine if the OTP is required for the authentication"); + conditionalOTP.setDescription( + "Flow to determine if the OTP is required for the authentication"); conditionalOTP.setProviderId(AuthenticationFlow.BASIC_FLOW); conditionalOTP = realm.addAuthenticationFlow(conditionalOTP); AuthenticationExecutionModel execution = new AuthenticationExecutionModel(); diff --git a/src/main/java/io/phasetwo/service/datastore/KeycloakOrgsExportImportManager.java b/src/main/java/io/phasetwo/service/datastore/KeycloakOrgsExportImportManager.java index 6a328d22..ad716921 100644 --- a/src/main/java/io/phasetwo/service/datastore/KeycloakOrgsExportImportManager.java +++ b/src/main/java/io/phasetwo/service/datastore/KeycloakOrgsExportImportManager.java @@ -1,5 +1,8 @@ package io.phasetwo.service.datastore; +import static io.phasetwo.service.Orgs.ORG_OWNER_CONFIG_KEY; +import static org.keycloak.models.utils.StripSecretsUtils.stripForExport; + import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import io.phasetwo.service.datastore.representation.KeycloakOrgsRealmRepresentation; @@ -14,6 +17,13 @@ import jakarta.ws.rs.NotAuthorizedException; import jakarta.ws.rs.core.HttpHeaders; import jakarta.ws.rs.core.MediaType; +import java.io.IOException; +import java.io.InputStream; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; import lombok.extern.jbosslog.JBossLog; import org.keycloak.common.util.CollectionUtil; import org.keycloak.exportimport.ExportAdapter; @@ -37,17 +47,6 @@ import org.keycloak.storage.datastore.DefaultExportImportManager; import org.keycloak.util.JsonSerialization; -import java.io.IOException; -import java.io.InputStream; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -import static io.phasetwo.service.Orgs.ORG_OWNER_CONFIG_KEY; -import static org.keycloak.models.utils.StripSecretsUtils.stripForExport; - @JBossLog public class KeycloakOrgsExportImportManager extends DefaultExportImportManager { private final KeycloakSession session; diff --git a/src/main/java/io/phasetwo/service/protocol/oidc/mappers/ActiveOrganizationMapper.java b/src/main/java/io/phasetwo/service/protocol/oidc/mappers/ActiveOrganizationMapper.java index d615314c..30b321fe 100644 --- a/src/main/java/io/phasetwo/service/protocol/oidc/mappers/ActiveOrganizationMapper.java +++ b/src/main/java/io/phasetwo/service/protocol/oidc/mappers/ActiveOrganizationMapper.java @@ -57,15 +57,15 @@ public ActiveOrganizationMapper() { @Override protected Map getOrganizationClaim( KeycloakSession session, RealmModel realm, UserModel user, ProtocolMapperModel mappingModel) { - ActiveOrganization activeOrganizationUtil = ActiveOrganization.fromContext(session, realm, user); + ActiveOrganization activeOrganizationUtil = + ActiveOrganization.fromContext(session, realm, user); if (!activeOrganizationUtil.isValid()) { return Maps.newHashMap(); } String inputProperties = mappingModel.getConfig().get(INCLUDED_ORGANIZATION_PROPERTIES); - List properties = Arrays.asList(inputProperties.replaceAll("\\s", "") - .split(",")); + List properties = Arrays.asList(inputProperties.replaceAll("\\s", "").split(",")); Map claim = Maps.newHashMap(); if (properties.contains(ID)) { diff --git a/src/main/java/io/phasetwo/service/resource/MembersResource.java b/src/main/java/io/phasetwo/service/resource/MembersResource.java index 85d69dd5..1bc6a3a2 100644 --- a/src/main/java/io/phasetwo/service/resource/MembersResource.java +++ b/src/main/java/io/phasetwo/service/resource/MembersResource.java @@ -69,10 +69,10 @@ public Response removeMember(@PathParam("userId") String userId) { if (!organization.hasMembership(member)) throw new NotFoundException(); - ActiveOrganization activeOrganizationUtil = ActiveOrganization - .fromContext(session, realm, member); - if (activeOrganizationUtil.isValid() && - activeOrganizationUtil.isCurrentActiveOrganization(organization.getId())) { + ActiveOrganization activeOrganizationUtil = + ActiveOrganization.fromContext(session, realm, member); + if (activeOrganizationUtil.isValid() + && activeOrganizationUtil.isCurrentActiveOrganization(organization.getId())) { member.setAttribute(ACTIVE_ORGANIZATION, new ArrayList<>()); EventBuilder event = new EventBuilder(realm, session, connection); @@ -80,8 +80,7 @@ public Response removeMember(@PathParam("userId") String userId) { .event(UPDATE_PROFILE) .user(user) .detail( - "removed_active_organization_id", - activeOrganizationUtil.getOrganization().getId()) + "removed_active_organization_id", activeOrganizationUtil.getOrganization().getId()) .success(); } diff --git a/src/main/java/io/phasetwo/service/resource/UserResource.java b/src/main/java/io/phasetwo/service/resource/UserResource.java index e3972521..14d3d3f9 100644 --- a/src/main/java/io/phasetwo/service/resource/UserResource.java +++ b/src/main/java/io/phasetwo/service/resource/UserResource.java @@ -108,8 +108,8 @@ public Response switchActiveOrganization(@Valid SwitchOrganization body) { @Path("/active-organization") @Produces(MediaType.APPLICATION_JSON) public Organization getActiveOrganization() { - ActiveOrganization activeOrganizationUtil = ActiveOrganization - .fromContext(session, realm, auth.getUser()); + ActiveOrganization activeOrganizationUtil = + ActiveOrganization.fromContext(session, realm, auth.getUser()); if (!activeOrganizationUtil.isValid()) { throw new NotAuthorizedException("Action not allowed."); diff --git a/src/main/java/io/phasetwo/service/util/ActiveOrganization.java b/src/main/java/io/phasetwo/service/util/ActiveOrganization.java index fc445c7c..56dc3b35 100644 --- a/src/main/java/io/phasetwo/service/util/ActiveOrganization.java +++ b/src/main/java/io/phasetwo/service/util/ActiveOrganization.java @@ -20,8 +20,7 @@ public class ActiveOrganization { private final RealmModel realm; private final UserModel user; private final OrganizationProvider organizationProvider; - @Getter() - private final OrganizationModel organization; + @Getter() private final OrganizationModel organization; public static ActiveOrganization fromContext( KeycloakSession session, RealmModel realm, UserModel user) { @@ -32,8 +31,10 @@ private ActiveOrganization(KeycloakSession session, RealmModel realm, UserModel this.realm = realm; this.user = user; this.organizationProvider = session.getProvider(OrganizationProvider.class); - this.organization = userHasActiveOrganizationAttribute() ? - initializeActiveOrganization() : initializeDefaultActiveOrganization(); + this.organization = + userHasActiveOrganizationAttribute() + ? initializeActiveOrganization() + : initializeDefaultActiveOrganization(); clearOutdatedActiveOrganizationAttribute(); } @@ -54,8 +55,7 @@ private OrganizationModel initializeDefaultActiveOrganization() { private void clearOutdatedActiveOrganizationAttribute() { if (!userHasOrganization() && userHasActiveOrganizationAttribute()) { user.setAttribute(ACTIVE_ORGANIZATION, new ArrayList<>()); - } - else if (organizationProvider + } else if (organizationProvider .getUserOrganizationsStream(realm, user) .noneMatch(org -> org.getId().equals(getActiveOrganizationIdFromAttribute()))) { log.warnf("%s doesn't belong to this organization", user.getUsername()); diff --git a/src/test/java/io/phasetwo/service/AbstractCypressOrganizationTest.java b/src/test/java/io/phasetwo/service/AbstractCypressOrganizationTest.java index 204cf6b1..24700fb8 100644 --- a/src/test/java/io/phasetwo/service/AbstractCypressOrganizationTest.java +++ b/src/test/java/io/phasetwo/service/AbstractCypressOrganizationTest.java @@ -37,7 +37,8 @@ public class AbstractCypressOrganizationTest { - protected static final boolean RUN_CYPRESS = Boolean.parseBoolean(System.getProperty("include.cypress", "false")); + protected static final boolean RUN_CYPRESS = + Boolean.parseBoolean(System.getProperty("include.cypress", "false")); public static final String KEYCLOAK_IMAGE = String.format( @@ -46,12 +47,12 @@ public class AbstractCypressOrganizationTest { public static final String ADMIN_CLI = "admin-cli"; static final String[] deps = { - "dnsjava:dnsjava", - "org.wildfly.client:wildfly-client-config", - "org.jboss.resteasy:resteasy-client", - "org.jboss.resteasy:resteasy-client-api", - "org.keycloak:keycloak-admin-client", - "io.phasetwo.keycloak:keycloak-events" + "dnsjava:dnsjava", + "org.wildfly.client:wildfly-client-config", + "org.jboss.resteasy:resteasy-client", + "org.jboss.resteasy:resteasy-client-api", + "org.keycloak:keycloak-admin-client", + "io.phasetwo.keycloak:keycloak-events" }; static List getDeps() { @@ -90,7 +91,7 @@ static List getDep(String pkg) { @BeforeAll public static void beforeAll() { if (!RUN_CYPRESS) { - return; //do nothing + return; // do nothing } Testcontainers.exposeHostPorts(WEBHOOK_SERVER_PORT); @@ -239,15 +240,13 @@ protected void createPublicClient(String clientId) { attributes.put("oidc.ciba.grant.enabled", false); body.putIfAbsent("attributes", attributes); - Response response = - getAdminRootRequest().body(body).post("clients").andReturn(); + Response response = getAdminRootRequest().body(body).post("clients").andReturn(); assertThat(response.getStatusCode(), is(Status.CREATED.getStatusCode())); } private String getClientId(String clientName) throws JsonProcessingException { // get clients - Response response = - getAdminRootRequest().when().get("clients?first=0&max=20").andReturn(); + Response response = getAdminRootRequest().when().get("clients?first=0&max=20").andReturn(); assertThat(response.getStatusCode(), is(Status.OK.getStatusCode())); return getElementId(response, "clientId", clientName); @@ -255,8 +254,7 @@ private String getClientId(String clientName) throws JsonProcessingException { private String getElementId(Response response, String targetKey, String targetValue) throws JsonProcessingException { - ArrayNode clientArrayNode = - (ArrayNode) objectMapper().readTree(response.getBody().asString()); + ArrayNode clientArrayNode = (ArrayNode) objectMapper().readTree(response.getBody().asString()); String id = ""; for (JsonNode clientJsonNode : clientArrayNode) { if (clientJsonNode.get(targetKey).asText().equals(targetValue)) { @@ -271,38 +269,25 @@ private String getElementId(Response response, String targetKey, String targetVa private RequestSpecification getAdminRootRequest() { return given() - .baseUri(container.getAuthServerUrl()) - .basePath("/admin/realms/" + REALM + "/") - .contentType("application/json") - .auth() - .oauth2(keycloak.tokenManager().getAccessTokenString()); + .baseUri(container.getAuthServerUrl()) + .basePath("/admin/realms/" + REALM + "/") + .contentType("application/json") + .auth() + .oauth2(keycloak.tokenManager().getAccessTokenString()); } protected void configureSelectOrgFlows() throws JsonProcessingException { ObjectMapper mapper = objectMapper(); RequestSpecification root = getAdminRootRequest(); - Response response = root - .when() - .get() - .then() - .extract() - .response(); + Response response = root.when().get().then().extract().response(); assertThat(response.getStatusCode(), is(Status.OK.getStatusCode())); JsonNode realm = mapper.readTree(response.getBody().asString()); ((ObjectNode) realm).put("browserFlow", ORG_BROWSER_AUTH_FLOW_ALIAS); ((ObjectNode) realm).put("directGrantFlow", ORG_DIRECT_GRANT_AUTH_FLOW_ALIAS); - response = root - .and() - .body(realm) - .when() - .put() - .then() - .extract() - .response(); + response = root.and().body(realm).when().put().then().extract().response(); assertThat(response.getStatusCode(), is(Status.NO_CONTENT.getStatusCode())); } - } diff --git a/src/test/java/io/phasetwo/service/AbstractOrganizationTest.java b/src/test/java/io/phasetwo/service/AbstractOrganizationTest.java index 5d5ab393..59e2b54c 100644 --- a/src/test/java/io/phasetwo/service/AbstractOrganizationTest.java +++ b/src/test/java/io/phasetwo/service/AbstractOrganizationTest.java @@ -3,8 +3,8 @@ import static io.phasetwo.service.Helpers.enableEvents; import static io.phasetwo.service.Helpers.objectMapper; import static io.phasetwo.service.Helpers.toJsonString; -import static io.phasetwo.service.Orgs.ORG_DIRECT_GRANT_AUTH_FLOW_ALIAS; import static io.phasetwo.service.Orgs.ORG_BROWSER_AUTH_FLOW_ALIAS; +import static io.phasetwo.service.Orgs.ORG_DIRECT_GRANT_AUTH_FLOW_ALIAS; import static io.restassured.RestAssured.given; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; @@ -595,8 +595,7 @@ private String getClientId(String clientName) throws JsonProcessingException { private String getElementId(Response response, String targetKey, String targetValue) throws JsonProcessingException { - ArrayNode clientArrayNode = - (ArrayNode) objectMapper().readTree(response.getBody().asString()); + ArrayNode clientArrayNode = (ArrayNode) objectMapper().readTree(response.getBody().asString()); String id = ""; for (JsonNode clientJsonNode : clientArrayNode) { if (clientJsonNode.get(targetKey).asText().equals(targetValue)) { @@ -643,26 +642,14 @@ protected void configureSelectOrgFlows() throws JsonProcessingException { ObjectMapper mapper = objectMapper(); RequestSpecification root = getAdminRootRequest(Optional.empty()); - Response response = root - .when() - .get() - .then() - .extract() - .response(); + Response response = root.when().get().then().extract().response(); assertThat(response.getStatusCode(), is(Status.OK.getStatusCode())); JsonNode realm = mapper.readTree(response.getBody().asString()); ((ObjectNode) realm).put("browserFlow", ORG_BROWSER_AUTH_FLOW_ALIAS); ((ObjectNode) realm).put("directGrantFlow", ORG_DIRECT_GRANT_AUTH_FLOW_ALIAS); - response = root - .and() - .body(realm) - .when() - .put() - .then() - .extract() - .response(); + response = root.and().body(realm).when().put().then().extract().response(); assertThat(response.getStatusCode(), is(Status.NO_CONTENT.getStatusCode())); } } diff --git a/src/test/java/io/phasetwo/service/CypressOrganizationTest.java b/src/test/java/io/phasetwo/service/CypressOrganizationTest.java index dd24910d..c61087ba 100644 --- a/src/test/java/io/phasetwo/service/CypressOrganizationTest.java +++ b/src/test/java/io/phasetwo/service/CypressOrganizationTest.java @@ -25,7 +25,8 @@ class CypressOrganizationTest extends AbstractCypressOrganizationTest { @TestFactory - List runCypressTests() throws IOException, InterruptedException, TimeoutException { + List runCypressTests() + throws IOException, InterruptedException, TimeoutException { if (!RUN_CYPRESS) { return Collections.emptyList(); } @@ -34,12 +35,12 @@ List runCypressTests() throws IOException, InterruptedExceptio setupSelectOrgTests(); - try ( - CypressContainer cypressContainer = new CypressContainer() + try (CypressContainer cypressContainer = + new CypressContainer() .withCreateContainerCmdModifier(cmd -> cmd.withUser(getUserSID())) - .withBaseUrl("http://host.testcontainers.internal:" + container.getHttpPort() + "/auth/") - .withBrowser("electron") - ) { + .withBaseUrl( + "http://host.testcontainers.internal:" + container.getHttpPort() + "/auth/") + .withBrowser("electron")) { cypressContainer.start(); CypressTestResults testResults = cypressContainer.getTestResults(); return convertToJUnitDynamicTests(testResults); @@ -63,25 +64,31 @@ private List convertToJUnitDynamicTests(CypressTestResults tes return dynamicContainers; } - private void createContainerFromSuite(List dynamicContainers, CypressTestSuite suite) { + private void createContainerFromSuite( + List dynamicContainers, CypressTestSuite suite) { List dynamicTests = new ArrayList<>(); for (CypressTest test : suite.getTests()) { - dynamicTests.add(DynamicTest.dynamicTest(test.getDescription(), () -> { - if (!test.isSuccess()) { - log.error(test.getErrorMessage()); - log.error(test.getStackTrace()); - } - Assertions.assertTrue(test.isSuccess()); - })); + dynamicTests.add( + DynamicTest.dynamicTest( + test.getDescription(), + () -> { + if (!test.isSuccess()) { + log.error(test.getErrorMessage()); + log.error(test.getStackTrace()); + } + Assertions.assertTrue(test.isSuccess()); + })); } dynamicContainers.add(DynamicContainer.dynamicContainer(suite.getTitle(), dynamicTests)); } private void setupSelectOrgTests() throws IOException { - OrganizationRepresentation org1 = createOrganization( - new OrganizationRepresentation().name("org-1").domains(List.of("org1.com"))); - OrganizationRepresentation org2 = createOrganization( - new OrganizationRepresentation().name("org-2").domains(List.of("org2.com"))); + OrganizationRepresentation org1 = + createOrganization( + new OrganizationRepresentation().name("org-1").domains(List.of("org1.com"))); + OrganizationRepresentation org2 = + createOrganization( + new OrganizationRepresentation().name("org-2").domains(List.of("org2.com"))); // User with 2 Org UserRepresentation user1 = createUserWithCredentials(keycloak, REALM, "user-1", "user-1"); @@ -105,5 +112,4 @@ private void setupSelectOrgTests() throws IOException { // Create a public client createPublicClient("public-client"); } - }