8000 Migrate Organization admin tests into new testsuite by hammadxcm · Pull Request #48207 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Migrate Organization admin tests into new testsuite - #48207

Closed
hammadxcm wants to merge 1 commit into
keycloak:mainfrom
hammadxcm:migrate-organization-admin-tests
Closed

hammadxcm wants to merge 1 commit into
keycloak:mainfrom
hammadxcm:migrate-organization-admin-tests

Conversation

@hammadxcm
@hammadxcm hammadxcm commented Apr 17, 2026 •
Copy link
Copy Markdown
Contributor

Parent tracking issue: #47926

Part of #48178 (complements #48203 which migrated OrganizationInvitationManagementTest).

Migrates the bulk of OrganizationTest (734 LOC) from testsuite/integration-arquillian/.../organization/admin/ to tests/base/.../organization/admin/.

Migrated (18 tests)

testUpdate, testUpdateConflict, testGet, testGetAll, testSearch, testSearchByAttributes, testCountEndpoint, testDelete, testAttributes, testDomains, testWithoutDomains, testFilterEmptyDomain, testDisabledOrganizationProvider, testCount, testFailUpdateAlias, testFailDuplicatedAlias, testSpecialCharsAlias, testInvalidRedirectUri. Note that testDomains is migrated with one sub-check removed (see below).

Kept in legacy module (1 of 19 tests)

  • testDeleteRealm — uses realmsResouce(), bc.setUpIdentityProvider(), and the legacy RealmBuilder. Requires cross-realm broker scaffolding that the new framework does not expose yet; stays in the legacy module so coverage is preserved. The legacy file is trimmed to only this one test.

One assertion trimmed from testDomains

The legacy testDomains included a one-line sub-check that "the same internet domain is allowed in a different realm" — implemented via adminClient.realm(bc.providerRealmName()). That requires cross-realm broker setup and has been replaced with a TODO comment in the migrated test. The assertion will return once the broker infra is ported.

Notable translations

  • testRealm() → realm.admin().
  • Assert.assertTrue(...) → JUnit 5 assertTrue(...) (and assertTrue(condition, message) argument order in JUnit 5).
  • getTestingClient().server(TEST_REALM_NAME).run(...) → @InjectRunOnServer RunOnServerClient.run(...).
  • new RealmAttributeUpdater(realm.admin()).setOrganizationsEnabled(FALSE).update() (try-with-resources) → inline realmRep.setOrganizationsEnabled(FALSE); realm.admin().update(realmRep) with a finally block that restores the flag. RealmAttributeUpdater has no equivalent in the new framework yet.
  • getCleanup().addCleanup(() -> ...) → realm.cleanup().add(r -> ...).
  • @Test / Assert.* imports swapped to JUnit 5; Hamcrest unchanged.

@ahus1
ahus1 commented Apr 18, 2026
Copy link
Copy Markdown
Member
  • Please avoid merging the main branch into the PR or rebasing the PR unless there are merge conflicts reported by GitHub or a reviewer asks you for a rebase. This prevents spamming reviewers with notifications and saves minutes on the GitHub actions CI.
  • Limit your PR to two open PRs at a time. Wait with opening more until those are closed - see "new contributors" section in the CONTRIBUTING.md
  • Sign-off your commits, otherwise they will not merged - again described in the CONTRIBUTING.md

@hammadxcm
Copy link
Copy Markdown
Contributor Author

Closing to honor the 2-open-PRs limit for new contributors (per @ahus1's feedback on #48207). I'll reopen this once #48203 and #48204 are reviewed/merged. Branch and commits are preserved on my fork (no loss).

@hammadxcm hammadxcm closed this Apr 18, 2026
@hammadxcm
Copy link
Copy Markdown
Contributor Author

Thanks @ahus1, applying all three:

  1. No more main merges / rebases — understood, I'll only touch the branches if there's a reported conflict or a reviewer asks.
  2. 2-PR limit — you already closed Migrate Organization Member API tests into new testsuite #48205, and I've closed this one (Migrate Organization admin tests into new testsuite #48207) as well. Migrate Organization Invitation Management tests into new testsuite #48203 and Migrate Organization Partial Export test into new testsuite #48204 are the remaining two; I'll hold off on reopening Migrate Organization Member API tests into new testsuite #48205 / Migrate Organization admin tests into new testsuite #48207 until those land.
  3. Sign-off — added Signed-off-by: to the two remaining commits (Migrate Organization Invitation Management tests into new testsuite #48203 at 911949f, Migrate Organization Partial Export test into new testsuite #48204 at f9f79da).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0