fix(sprint-17 backend): 3 blockers de boot Quarkus en test
Découverts en cascade après désactivation du KC DevService (commits précédents).
Avant, le KC DevService masquait ces 3 bugs en fournissant auto auth-server-url
et en différant l'init Hibernate.
1. PispiPaymentProvider.institutionBic — bug SmallRye Config 3.20+ :
defaultValue = "" déclenche 'Failed to load config value' au boot.
Pattern documenté dans memory feedback_quarkus_smallrye_config_empty_default.md.
Fix : remplacer par Optional<String> + orElse("") en @PostConstruct, comme
les deux autres @ConfigProperty de la même classe.
2. quarkus.oidc.auth-server-url manquant en test :
MembreKeycloakSyncService injecte la prop sans defaultValue ⇒ requise au boot.
Auparavant fournie par KC DevService. Ajout d'un stub
http://localhost:0/realms/unionflow-test-stub dans application-test.properties
(jamais utilisé : tenant-enabled=false).
3. quarkus.hibernate-orm.mapping.format.global=ignore manquant :
Bug Quarkus 3.27 (memory feedback_quarkus_327_format_mapper.md) : avec
write-dates-as-timestamps=false + colonnes JSONB, Hibernate refuse de réutiliser
le FormatMapper REST. Opt-in pour le comportement Quarkus 4 par défaut.
Smoke test : AuthCallbackResourceTest 10/10 verts en 9.6s.
This commit is contained in:
@@ -44,16 +44,19 @@ public class PispiPaymentProvider implements PaymentProvider {
|
|||||||
@ConfigProperty(name = "pispi.institution.code")
|
@ConfigProperty(name = "pispi.institution.code")
|
||||||
java.util.Optional<String> institutionCodeOpt;
|
java.util.Optional<String> institutionCodeOpt;
|
||||||
|
|
||||||
@ConfigProperty(name = "pispi.institution.bic", defaultValue = "")
|
// SmallRye Config 3.20+ : defaultValue = "" casse au boot ; utiliser Optional + orElse("").
|
||||||
String institutionBic;
|
@ConfigProperty(name = "pispi.institution.bic")
|
||||||
|
java.util.Optional<String> institutionBicOpt;
|
||||||
|
|
||||||
String clientId;
|
String clientId;
|
||||||
String institutionCode;
|
String institutionCode;
|
||||||
|
String institutionBic;
|
||||||
|
|
||||||
@jakarta.annotation.PostConstruct
|
@jakarta.annotation.PostConstruct
|
||||||
void init() {
|
void init() {
|
||||||
clientId = clientIdOpt.orElse("");
|
clientId = clientIdOpt.orElse("");
|
||||||
institutionCode = institutionCodeOpt.orElse("");
|
institutionCode = institutionCodeOpt.orElse("");
|
||||||
|
institutionBic = institutionBicOpt.orElse("");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -23,6 +23,12 @@ quarkus.flyway.baseline-on-migrate=false
|
|||||||
# Configuration Keycloak pour tests (désactivé)
|
# Configuration Keycloak pour tests (désactivé)
|
||||||
quarkus.oidc.tenant-enabled=false
|
quarkus.oidc.tenant-enabled=false
|
||||||
quarkus.keycloak.policy-enforcer.enabled=false
|
quarkus.keycloak.policy-enforcer.enabled=false
|
||||||
|
# Dummy auth-server-url : satisfait la validation @ConfigProperty au boot
|
||||||
|
# (MembreKeycloakSyncService inject la prop sans defaultValue). Avec tenant-enabled=false,
|
||||||
|
# la valeur n'est jamais utilisée — uniquement nécessaire pour passer la validation.
|
||||||
|
# Avant : KC DevService fournissait l'URL automatiquement ; depuis qu'on désactive
|
||||||
|
# devservices.enabled (cf. plus bas), il faut fournir une valeur stub.
|
||||||
|
quarkus.oidc.auth-server-url=http://localhost:0/realms/unionflow-test-stub
|
||||||
#
|
#
|
||||||
# Désactivation GLOBALE des DevServices en mode test.
|
# Désactivation GLOBALE des DevServices en mode test.
|
||||||
# Pourquoi le global et pas seulement quarkus.keycloak.devservices.enabled=false :
|
# Pourquoi le global et pas seulement quarkus.keycloak.devservices.enabled=false :
|
||||||
|
|||||||
@@ -26,6 +26,12 @@ keycloak.admin.realm=${KEYCLOAK_REALM:unionflow}
|
|||||||
quarkus.jackson.write-dates-as-timestamps=false
|
quarkus.jackson.write-dates-as-timestamps=false
|
||||||
quarkus.jackson.serialization-inclusion=non_null
|
quarkus.jackson.serialization-inclusion=non_null
|
||||||
|
|
||||||
|
# Quarkus 3.27 breaking change : avec ObjectMapper customisé (write-dates-as-timestamps=false)
|
||||||
|
# + colonnes JSONB Hibernate, le boot échoue par défaut (« ne pas réutiliser le FormatMapper
|
||||||
|
# REST pour la persistance »). On opt-in pour le comportement futur (sera le défaut Quarkus 4)
|
||||||
|
# qui ignore le mapper customisé pour les colonnes JSONB et utilise le mapper Hibernate par défaut.
|
||||||
|
quarkus.hibernate-orm.mapping.format.global=ignore
|
||||||
|
|
||||||
# Configuration HTTP
|
# Configuration HTTP
|
||||||
quarkus.http.port=8085
|
quarkus.http.port=8085
|
||||||
quarkus.http.host=0.0.0.0
|
quarkus.http.host=0.0.0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user