apupier opened a new pull request, #30264: URL: https://github.com/apache/camel/pull/30264
# Description Fixes the 9 `KeycloakTestInfraIT` organization tests that fail on ppc64le in the `Camel Core (Build and test)` main build [#2475](https://ci-builds.apache.org/job/Camel/job/Camel%20Core%20(Build%20and%20test)/job/main/2475/testReport/), as reported in [this comment](https://issues.apache.org/jira/browse/CAMEL-26902?focusedId=18146114&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-18146114) on CAMEL-26902. ## Cause The ppc64le image is still Keycloak 26.0.5 (`keycloak.container.ppc64le`), while `camel-keycloak` uses `keycloak-core` 26.8.1. In the 26.8 client, `OrganizationDomainRepresentation` has two new fields, `identityProviderAlias` and `autoRedirect`. `autoRedirect` is a primitive `boolean`, so it is always serialized, as `false`. A Keycloak 26.0 server answers `400 Unrecognized field "autoRedirect"`. `testCreateOrganization` fails first and the 8 other organization tests fail because `testOrgId` is never set. This is not caused by the 26.8.2 container bump: it reproduces locally with `keycloak:26.0.5` and passes on 26.8.2. ## Change `createOrganization` builds the domain from a private subclass `LegacyOrganizationDomain` annotated with `@JsonIgnoreProperties({"autoRedirect", "identityProviderAlias"})`. The producer never set these fields. The upgrade guide entry of CAMEL-26902 now states that camel-keycloak is tested with Keycloak 26.8.2 on amd64 and 26.0.5 on ppc64le, and mentions this change. ## Verification - `KeycloakTestInfraIT` with `-Dkeycloak.container=mirror.gcr.io/keycloak/keycloak:26.0.5`: 9 of 56 failed before, 56 of 56 pass after. - Full `mvn verify` of `components/camel-keycloak` passes on the default 26.8.2 container and on 26.0.5 (177 unit tests, 133 ITs, 31 skipped as before). `formatter:format impsort:sort` changes nothing. - Audit of the other operations: the fields of the 19 representation classes used by `KeycloakProducer` were compared between `keycloak-core` 26.0.5 and 26.8.1. A default instance of each was serialized with the 26.8.1 `JsonSerialization` and read back with a strict mapper on 26.0.5. Only `OrganizationDomainRepresentation` fails: the other new fields are objects, null by default, and omitted by `NON_NULL`. ## Limits A `pojoRequest` body that sets a new field is not covered and stays the responsibility of the caller. The alternative is to skip the organization tests on ppc64le. # Target - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch) # Tracking - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it). # Apache Camel coding standards and style - [x] I checked that each commit in the pull request has a meaningful subject line and body. - [x] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes. --- _Description generated by IBM Bob (AI) on behalf of apupier._ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
