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

Skip to content

Migrate Organization Member API tests into new testsuite - #48205

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

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

Conversation

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

Parent tracking issue: #47926

Part of #48184

Migrates the API-only half of OrganizationMemberTest from testsuite/integration-arquillian/.../organization/member/ to the new framework under tests/base/.../organization/member/.

Migrated (17 tests)

testUpdate, testUserAlreadyMemberOfOrganization, testGet, testGetMemberOrganization, testGetMemberOrganizationRequiresMembershipInCurrentOrganization, testGetAll, testDeleteUnmanagedMember, testUpdateEmailUnmanagedMember, testDeleteMembersOnOrganizationRemoval, testSearchMembers, testSearchMembersWithSqlWildcards, testAddMemberFromDifferentRealm, testMemberInMultipleOrganizations, testMembersCount, testNonMemberCanUnsetEmailThatMatchesOrg, testGetMemberOrganizationsBriefVsFullRepresentation, testGetMemberOrganizationsForbiddenForNonAdminUser.

All 17 rely only on the organization admin API and cleanly map to the new framework helpers already provided by AbstractOrganizationTest + MemberRepresentation-driven assertions.

Not migrated (legacy file retains 4 tests)

  • testGetAllDisabledOrganization
  • testGetAllDisabledOrganizationProvider
  • testUserFederatedBeforeTheIDPBoundWithAnOrgIsNotMember
  • testManagedMemberOnlyRemovedFromHomeOrganization

Each of these requires the legacy BrokerConfiguration flow (bc.getUserLogin(), assertBrokerRegistration(...), realmsResouce().realm(bc.providerRealmName()), broker login via loginPage). The new framework has no equivalent yet, so these stay in the legacy module until the broker infra is ported.

OrganizationMemberWithLdapTest is also untouched — it depends on AbstractLDAPTest scaffolding that isn't available in the new framework.

Notable translations

  • testRealm() → realm.admin().
  • getCleanup().addCleanup(...) → realm.cleanup().add(r -> ...).
  • getTestingClient().server(TEST_REALM_NAME).run(session -> ...) → @InjectRunOnServer RunOnServerClient.run(session -> ...).
  • UserBuilder.create() → UserConfigBuilder.create() (legacy UserBuilder is not on the new-framework classpath).
  • AdminClientUtil.createAdminClient(...) → KeycloakBuilder.builder() driven by @InjectKeycloakUrls KeycloakUrls.
  • JUnit 4 annotations/assertions swapped for JUnit 5; Hamcrest matchers unchanged.

@hammadxcm
hammadxcm 8000 force-pushed the migrate-organization-member-tests branch from 2eb7532 to 979ae71 Compare April 18, 2026 08:35
@ahus1
ahus1 commented Apr 18, 2026
Copy link
Copy Markdown
Member

Limiting open PRs for new contributors to two open PRs at a time.

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