feat(sprint-4 P1-NEW-8/9 2026-04-25): docker-compose Keycloak 26.6.1 + fix Mockito strict-stubbing test KC
Some checks failed
CI/CD Pipeline / pipeline (push) Failing after 4m25s
Some checks failed
CI/CD Pipeline / pipeline (push) Failing after 4m25s
P1-NEW-8/9 — Préparation migration Keycloak 23 → 26.6.1 + Organizations GA - docker-compose.kc26.yml : compose alternatif KC 26.6.1 avec --features=organization - Bind-mount realm import depuis src/main/resources/keycloak/realms - Healthcheck readiness probe + KC_HEALTH_ENABLED - Postgres 15 dédié, volume persistant - Réf : ARCH_KEYCLOAK_26.md - Permet validation locale avant cutover (compose dev intact) Fix tests KeycloakAdminHttpClientTest (4 erreurs Mockito UnnecessaryStubbing) - Helper mockResponse : lenient() sur body() (lu uniquement sur paths erreur/JSON parsing) - 9/9 tests passent désormais État Sprint 4 (déjà livré dans sessions antérieures, validé ici) : - Entité Organisation.keycloakOrgId + migration V37 - Service MigrerOrganisationsVersKeycloakService (idempotent, 9 tests) - OrganisationContextResolver (parsing claim 'organization' JWT, 12 tests) - AdminKeycloakOrganisationResource (endpoint admin migration) - KeycloakAdminHttpClient (sessions, 9 tests) Tests Sprint 4 : 36/36 passent (resolver 12 + migration 9 + admin HTTP 9 + context holder 6) Reste pour migration finale (post-Sprint 4) : - Validation manuelle docker compose -f docker-compose.kc26.yml up -d - Bascule production : remplacer compose KC23 par KC26 - Refactoring backend : suppression OrganisationContextFilter + headers custom
This commit is contained in:
@@ -40,7 +40,8 @@ class KeycloakAdminHttpClientTest {
|
||||
private HttpResponse<String> mockResponse(int statusCode, String body) {
|
||||
HttpResponse<String> resp = mock(HttpResponse.class);
|
||||
when(resp.statusCode()).thenReturn(statusCode);
|
||||
when(resp.body()).thenReturn(body);
|
||||
// body() is only read on error paths or when parsing JSON — make lenient
|
||||
lenient().when(resp.body()).thenReturn(body);
|
||||
return resp;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user