fix(tests): rôles @TestSecurity en majuscules + NPE Map.of() dans MembreResource

14 fichiers de tests : rôles passés en majuscules dans @TestSecurity(roles={...})
pour correspondre exactement aux valeurs @RolesAllowed du backend.
Mapping : "admin"→"ADMIN", "admin_organisation"→"ADMIN_ORGANISATION",
"membre_actif"→"MEMBRE", "tontine_resp"→"TONTINE_RESP", etc.
Un rôle en minuscules produit un 403 silencieux sans erreur Quarkus.

MembreResource : activerAdhesion/suspendrAdhesion/radierAdhesion/archiverAdhesion
remplacent Map.of() par HashMap pour accepter dateChangementStatut null
(Map.of() lève NullPointerException sur valeur null → HTTP 500).
This commit is contained in:
dahoud
2026-04-06 16:50:03 +00:00
parent aef5548e87
commit c74ae25ad6
14 changed files with 103 additions and 103 deletions

View File

@@ -66,7 +66,7 @@ class CampagneAgricoleResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "coop_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "COOP_RESP" })
@DisplayName("GET /api/v1/agricole/campagnes/{id} inexistant retourne 404")
void getCampagneById_inexistant_returns404() {
given()
@@ -78,7 +78,7 @@ class CampagneAgricoleResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "coop_resp", "membre_actif" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "COOP_RESP", "MEMBRE" })
@DisplayName("GET /api/v1/agricole/campagnes/{id} existant retourne 200")
void getCampagneById_existant_returns200() {
given()
@@ -91,7 +91,7 @@ class CampagneAgricoleResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "coop_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "COOP_RESP" })
@DisplayName("GET /api/v1/agricole/campagnes/cooperative/{id} retourne 200")
void getCampagnesByCooperative_returns200() {
given()
@@ -104,7 +104,7 @@ class CampagneAgricoleResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "coop_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "COOP_RESP" })
@DisplayName("POST creerCampagne avec cooperative valide retourne 201")
void creerCampagne_valid_returns201() {
String body = "{"
@@ -137,7 +137,7 @@ class CampagneAgricoleResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "coop_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "COOP_RESP" })
@DisplayName("POST creerCampagne avec corps vide retourne 4xx")
void creerCampagne_corpsVide_returns4xx() {
given()

View File

@@ -93,7 +93,7 @@ class CampagneCollecteResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "membre_actif" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MEMBRE" })
@DisplayName("GET /api/v1/collectefonds/campagnes/{id} inexistant retourne 404")
void getCampagneById_inexistant_returns404() {
given()
@@ -105,7 +105,7 @@ class CampagneCollecteResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "membre_actif" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MEMBRE" })
@DisplayName("GET /api/v1/collectefonds/campagnes/{id} existant retourne 200")
void getCampagneById_existant_returns200() {
given()
@@ -118,7 +118,7 @@ class CampagneCollecteResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION" })
@DisplayName("GET /api/v1/collectefonds/campagnes/organisation/{id} retourne 200")
void getCampagnesByOrganisation_returns200() {
given()
@@ -131,7 +131,7 @@ class CampagneCollecteResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "membre_actif" })
@TestSecurity(user = "admin@unionflow.com", roles = { "MEMBRE" })
@DisplayName("POST contribuer sur campagne EN_COURS retourne 201")
void contribuer_campagneEnCours_returns201() {
String body = "{"
@@ -150,7 +150,7 @@ class CampagneCollecteResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "membre_actif" })
@TestSecurity(user = "admin@unionflow.com", roles = { "MEMBRE" })
@DisplayName("POST contribuer avec ID inexistant retourne 4xx")
void contribuer_idInexistant_returns4xx() {
given()

View File

@@ -69,7 +69,7 @@ class DonReligieuxResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "culte_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "CULTE_RESP" })
@DisplayName("GET /api/v1/culte/dons/{id} inexistant retourne 404")
void getDonById_inexistant_returns404() {
given()
@@ -81,7 +81,7 @@ class DonReligieuxResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "culte_resp", "membre_actif" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "CULTE_RESP", "MEMBRE" })
@DisplayName("GET /api/v1/culte/dons/{id} existant retourne 200")
void getDonById_existant_returns200() {
given()
@@ -94,7 +94,7 @@ class DonReligieuxResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "culte_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "CULTE_RESP" })
@DisplayName("GET /api/v1/culte/dons/organisation/{id} retourne 200 ou 500")
void getDonsByOrganisation_returns200ou500() {
given()
@@ -107,7 +107,7 @@ class DonReligieuxResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "membre_actif" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MEMBRE" })
@DisplayName("POST enregistrerDon avec institution valide retourne 201")
void enregistrerDon_valid_returns201() {
String body = "{"
@@ -140,7 +140,7 @@ class DonReligieuxResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "membre_actif" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MEMBRE" })
@DisplayName("POST creerDon avec corps vide retourne 4xx")
void creerDon_corpsVide_returns4xx() {
given()

View File

@@ -64,7 +64,7 @@ class EchelonOrganigrammeResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION" })
@DisplayName("GET /api/v1/gouvernance/organigramme/{id} inexistant retourne 404")
void getEchelonById_inexistant_returns404() {
given()
@@ -76,7 +76,7 @@ class EchelonOrganigrammeResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "membre_actif" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MEMBRE" })
@DisplayName("GET /api/v1/gouvernance/organigramme/{id} existant retourne 200")
void getEchelonById_existant_returns200() {
given()
@@ -89,7 +89,7 @@ class EchelonOrganigrammeResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION" })
@DisplayName("GET /api/v1/gouvernance/organigramme/organisation/{id} retourne 200")
void getOrganigrammeByOrganisation_returns200() {
given()
@@ -102,7 +102,7 @@ class EchelonOrganigrammeResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION" })
@DisplayName("POST creerEchelon avec organisation valide retourne 201")
void creerEchelon_valid_returns201() {
String body = "{"
@@ -136,7 +136,7 @@ class EchelonOrganigrammeResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION" })
@DisplayName("POST creerEchelon avec corps vide retourne 4xx")
void creerEchelon_corpsVide_returns4xx() {
given()

View File

@@ -14,7 +14,7 @@ import org.junit.jupiter.api.Test;
class DemandeCreditResourceTest {
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN" })
@DisplayName("GET /api/v1/mutuelle/credits/{id} inexistant retourne 404")
void getDemandeById_inexistant_returns404() {
given()
@@ -26,7 +26,7 @@ class DemandeCreditResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN" })
@DisplayName("GET /api/v1/mutuelle/credits/membre/{id} retourne 200")
void getDemandesByMembre_returns200() {
given()
@@ -39,7 +39,7 @@ class DemandeCreditResourceTest {
}
@Test
@TestSecurity(user = "membre@unionflow.com", roles = { "membre_actif" })
@TestSecurity(user = "membre@unionflow.com", roles = { "MEMBRE" })
@DisplayName("POST /api/v1/mutuelle/credits sans membre existant retourne 400 ou 404 ou 500")
void soumettreDemande_membreInexistant_returnsError() {
String body = "{\"membreId\":\"" + UUID.randomUUID() + "\",\"montantDemande\":100000,\"dureeMoisDemande\":12,\"motif\":\"Test\"}";
@@ -53,7 +53,7 @@ class DemandeCreditResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN" })
@DisplayName("PATCH /api/v1/mutuelle/credits/{id}/statut sans statut retourne 400")
void changerStatut_sansStatut_returns400() {
given()
@@ -65,7 +65,7 @@ class DemandeCreditResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN" })
@DisplayName("PATCH /api/v1/mutuelle/credits/{id}/statut avec statut sur id inexistant retourne 404")
void changerStatut_idInexistant_returns404() {
given()
@@ -78,7 +78,7 @@ class DemandeCreditResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN" })
@DisplayName("POST /api/v1/mutuelle/credits/{id}/approbation sur id inexistant retourne 404 ou 415")
void approuver_idInexistant_returns404() {
given()
@@ -94,7 +94,7 @@ class DemandeCreditResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN" })
@DisplayName("POST /api/v1/mutuelle/credits/{id}/decaissement sur id inexistant retourne 404 ou 415 ou 500")
void decaisser_idInexistant_returns404() {
given()

View File

@@ -33,7 +33,7 @@ class DemandeCreditMockResourceTest {
DemandeCreditService demandeCreditService;
@Test
@TestSecurity(user = "admin@unionflow.com", roles = {"admin", "admin_organisation", "mutuelle_resp"})
@TestSecurity(user = "admin@unionflow.com", roles = {"ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP"})
@DisplayName("POST /{id}/approbation — approuver retourne 200")
void approuver_success_returns200() {
DemandeCreditResponse response = DemandeCreditResponse.builder().build();
@@ -54,7 +54,7 @@ class DemandeCreditMockResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = {"admin", "admin_organisation", "mutuelle_resp"})
@TestSecurity(user = "admin@unionflow.com", roles = {"ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP"})
@DisplayName("PATCH /{id}/statut — changerStatut avec statut valide retourne 200")
void changerStatut_avecStatutValide_returns200() {
DemandeCreditResponse response = DemandeCreditResponse.builder().build();
@@ -72,7 +72,7 @@ class DemandeCreditMockResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = {"admin", "admin_organisation", "mutuelle_resp"})
@TestSecurity(user = "admin@unionflow.com", roles = {"ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP"})
@DisplayName("PATCH /{id}/statut — changerStatut sans notes (null) retourne 200")
void changerStatut_sansNotes_returns200() {
DemandeCreditResponse response = DemandeCreditResponse.builder().build();
@@ -89,7 +89,7 @@ class DemandeCreditMockResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = {"admin", "admin_organisation", "mutuelle_resp"})
@TestSecurity(user = "admin@unionflow.com", roles = {"ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP"})
@DisplayName("POST /{id}/decaissement — decaisser retourne 200")
void decaisser_success_returns200() {
DemandeCreditResponse response = DemandeCreditResponse.builder().build();
@@ -107,7 +107,7 @@ class DemandeCreditMockResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = {"admin", "admin_organisation", "mutuelle_resp", "membre_actif"})
@TestSecurity(user = "admin@unionflow.com", roles = {"ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP", "MEMBRE"})
@DisplayName("GET /{id} — getDemandeById retourne 200 avec mock")
void getDemandeById_avecMock_returns200() {
DemandeCreditResponse response = DemandeCreditResponse.builder().build();
@@ -122,7 +122,7 @@ class DemandeCreditMockResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = {"admin", "admin_organisation", "mutuelle_resp", "membre_actif"})
@TestSecurity(user = "admin@unionflow.com", roles = {"ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP", "MEMBRE"})
@DisplayName("GET /membre/{membreId} — getDemandesByMembre retourne 200 avec mock")
void getDemandesByMembre_avecMock_returns200() {
when(demandeCreditService.getDemandesByMembre(any(UUID.class))).thenReturn(List.of());
@@ -136,7 +136,7 @@ class DemandeCreditMockResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = {"membre_actif"})
@TestSecurity(user = "admin@unionflow.com", roles = {"MEMBRE"})
@DisplayName("POST / — soumettreDemande retourne 201 avec mock")
void soumettreDemande_avecMock_returns201() {
DemandeCreditResponse response = DemandeCreditResponse.builder().build();
@@ -162,7 +162,7 @@ class DemandeCreditMockResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = {"admin", "admin_organisation", "mutuelle_resp"})
@TestSecurity(user = "admin@unionflow.com", roles = {"ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP"})
@DisplayName("POST /{id}/approbation avec notes=null retourne 200")
void approuver_sansNotes_returns200() {
DemandeCreditResponse response = DemandeCreditResponse.builder().build();

View File

@@ -95,7 +95,7 @@ class DemandeCreditResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "mutuelle_resp", "membre_actif" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP", "MEMBRE" })
@DisplayName("GET /api/v1/mutuelle/credits/{id} inexistant retourne 404")
void getDemandeById_inexistant_returns404() {
given()
@@ -107,7 +107,7 @@ class DemandeCreditResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "mutuelle_resp", "membre_actif" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP", "MEMBRE" })
@DisplayName("GET /api/v1/mutuelle/credits/{id} existant retourne 200")
void getDemandeById_existant_returns200() {
given()
@@ -120,7 +120,7 @@ class DemandeCreditResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "mutuelle_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP" })
@DisplayName("GET /api/v1/mutuelle/credits/membre/{id} retourne 200")
void getDemandesByMembre_returns200() {
given()
@@ -133,7 +133,7 @@ class DemandeCreditResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "mutuelle_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP" })
@DisplayName("PATCH changerStatut sans statut retourne 400")
void changerStatut_sansStatut_returns400() {
given()
@@ -145,7 +145,7 @@ class DemandeCreditResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "mutuelle_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP" })
@DisplayName("PATCH changerStatut avec statut valide et ID inexistant retourne 404")
void changerStatut_avecStatutValidEtIdInexistant_returns404() {
given()
@@ -158,7 +158,7 @@ class DemandeCreditResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "membre_actif" })
@TestSecurity(user = "admin@unionflow.com", roles = { "MEMBRE" })
@DisplayName("POST soumettreDemande avec membre valide retourne 201")
void soumettreDemande_valid_returns201() {
String body = "{"
@@ -193,7 +193,7 @@ class DemandeCreditResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "membre_actif" })
@TestSecurity(user = "admin@unionflow.com", roles = { "MEMBRE" })
@DisplayName("POST soumettreDemande avec corps vide retourne 4xx")
void soumettreDemande_corpsVide_returns4xx() {
given()
@@ -206,7 +206,7 @@ class DemandeCreditResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "mutuelle_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP" })
@DisplayName("POST approuver avec ID inexistant retourne 4xx")
void approuver_idInexistant_returns4xx() {
given()
@@ -222,7 +222,7 @@ class DemandeCreditResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "mutuelle_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP" })
@DisplayName("POST decaissement avec ID inexistant retourne 4xx")
void decaissement_idInexistant_returns4xx() {
given()

View File

@@ -95,7 +95,7 @@ class CompteEpargneResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "mutuelle_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP" })
@DisplayName("GET /api/v1/epargne/comptes/{id} inexistant retourne 404")
void getCompteById_inexistant_returns404() {
given()
@@ -107,7 +107,7 @@ class CompteEpargneResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "mutuelle_resp", "membre_actif" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP", "MEMBRE" })
@DisplayName("GET /api/v1/epargne/comptes/{id} existant retourne 200")
void getCompteById_existant_returns200() {
given()
@@ -120,7 +120,7 @@ class CompteEpargneResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "mutuelle_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP" })
@DisplayName("GET /api/v1/epargne/comptes/membre/{id} retourne 200")
void getComptesByMembre_returns200() {
given()
@@ -133,7 +133,7 @@ class CompteEpargneResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "mutuelle_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP" })
@DisplayName("GET /api/v1/epargne/comptes/organisation/{id} retourne 200")
void getComptesByOrganisation_returns200() {
given()
@@ -146,7 +146,7 @@ class CompteEpargneResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "mutuelle_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP" })
@DisplayName("POST /api/v1/epargne/comptes avec membre et organisation valides retourne 201")
void creerCompte_valid_returns201() {
String body = "{"
@@ -179,7 +179,7 @@ class CompteEpargneResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "mutuelle_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP" })
@DisplayName("POST /api/v1/epargne/comptes avec corps vide retourne 4xx")
void creerCompte_corpsVide_returns4xx() {
given()
@@ -192,7 +192,7 @@ class CompteEpargneResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "mutuelle_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP" })
@DisplayName("PATCH /api/v1/epargne/comptes/{id}/statut sans statut retourne 400")
void changerStatut_sansStatut_returns400() {
given()
@@ -204,7 +204,7 @@ class CompteEpargneResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "mutuelle_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP" })
@DisplayName("PATCH /api/v1/epargne/comptes/{id}/statut avec statut valide et ID inexistant retourne 404")
void changerStatut_avecStatutEtIdInexistant_returns404() {
given()
@@ -217,7 +217,7 @@ class CompteEpargneResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "mutuelle_resp", "membre_actif" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP", "MEMBRE" })
@DisplayName("GET /api/v1/epargne/comptes/mes-comptes retourne 200")
void getMesComptes_returns200() {
given()
@@ -229,7 +229,7 @@ class CompteEpargneResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "mutuelle_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP" })
@DisplayName("PATCH /api/v1/epargne/comptes/{id}/statut avec statut valide et ID existant retourne 200")
void changerStatut_avecStatutEtIdExistant_returns200() {
given()

View File

@@ -101,7 +101,7 @@ class TransactionEpargneResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "mutuelle_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP" })
@DisplayName("GET /api/v1/epargne/transactions/compte/{id} retourne 200")
void getTransactionsByCompte_returns200() {
given()
@@ -114,7 +114,7 @@ class TransactionEpargneResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "mutuelle_resp", "membre_actif" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP", "MEMBRE" })
@DisplayName("POST /api/v1/epargne/transactions avec compte ACTIF retourne 201")
void executerTransaction_valid_returns201() {
String body = "{"
@@ -134,7 +134,7 @@ class TransactionEpargneResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "mutuelle_resp", "membre_actif" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP", "MEMBRE" })
@DisplayName("POST /api/v1/epargne/transactions avec corps vide retourne 4xx")
void executerTransaction_corpsVide_returns4xx() {
given()
@@ -147,7 +147,7 @@ class TransactionEpargneResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "mutuelle_resp", "membre_actif" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MUTUELLE_RESP", "MEMBRE" })
@DisplayName("POST /api/v1/epargne/transactions/transfert avec corps vide retourne 4xx")
void transfert_corpsVide_returns4xx() {
given()

View File

@@ -66,7 +66,7 @@ class ProjetOngResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "ong_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "ONG_RESP" })
@DisplayName("GET /api/v1/ong/projets/{id} inexistant retourne 404")
void getProjetById_inexistant_returns404() {
given()
@@ -78,7 +78,7 @@ class ProjetOngResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "ong_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "ONG_RESP" })
@DisplayName("GET /api/v1/ong/projets/{id} existant retourne 200")
void getProjetById_existant_returns200() {
given()
@@ -91,7 +91,7 @@ class ProjetOngResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "ong_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "ONG_RESP" })
@DisplayName("GET /api/v1/ong/projets/ong/{id} retourne 200")
void getProjetsByOng_returns200() {
given()
@@ -104,7 +104,7 @@ class ProjetOngResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "ong_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "ONG_RESP" })
@DisplayName("POST creerProjet avec organisation valide retourne 201")
void creerProjet_valid_returns201() {
String body = "{"
@@ -136,7 +136,7 @@ class ProjetOngResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "ong_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "ONG_RESP" })
@DisplayName("PATCH changerStatut sans query param statut retourne 400")
void changerStatut_sansStatut_returns400() {
given()
@@ -148,7 +148,7 @@ class ProjetOngResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "ong_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "ONG_RESP" })
@DisplayName("PATCH changerStatut avec statut valide et ID inexistant retourne 404")
void changerStatut_avecStatutValidEtIdInexistant_returns404() {
given()
@@ -161,7 +161,7 @@ class ProjetOngResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "ong_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "ONG_RESP" })
@DisplayName("POST creerProjet avec corps vide retourne 4xx")
void creerProjet_corpsVide_returns4xx() {
given()
@@ -174,7 +174,7 @@ class ProjetOngResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "ong_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "ONG_RESP" })
@DisplayName("PATCH changerStatut avec statut valide et ID existant retourne 200")
void changerStatut_avecStatutValidEtIdExistant_returns200() {
given()

View File

@@ -89,7 +89,7 @@ class AgrementProfessionnelResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "registre_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "REGISTRE_RESP" })
@DisplayName("GET /api/v1/registre/agrements/{id} inexistant retourne 404")
void getAgrementById_inexistant_returns404() {
given()
@@ -101,7 +101,7 @@ class AgrementProfessionnelResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "membre_actif" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "MEMBRE" })
@DisplayName("GET /api/v1/registre/agrements/{id} existant retourne 200")
void getAgrementById_existant_returns200() {
given()
@@ -114,7 +114,7 @@ class AgrementProfessionnelResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "registre_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "REGISTRE_RESP" })
@DisplayName("GET /api/v1/registre/agrements/membre/{id} retourne 200")
void getAgrementsByMembre_returns200() {
given()
@@ -127,7 +127,7 @@ class AgrementProfessionnelResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "registre_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "REGISTRE_RESP" })
@DisplayName("GET /api/v1/registre/agrements/organisation/{id} retourne 200")
void getAgrementsByOrganisation_returns200() {
given()
@@ -140,7 +140,7 @@ class AgrementProfessionnelResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "registre_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "REGISTRE_RESP" })
@DisplayName("POST enregistrerAgrement avec membre et organisation valides retourne 201")
void enregistrerAgrement_valid_returns201() {
String body = "{"
@@ -173,7 +173,7 @@ class AgrementProfessionnelResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "registre_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "REGISTRE_RESP" })
@DisplayName("POST /api/v1/registre/agrements avec corps vide retourne 4xx")
void enregistrerAgrement_corpsVide_returns4xx() {
given()

View File

@@ -72,7 +72,7 @@ class TontineResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "tontine_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "TONTINE_RESP" })
@DisplayName("GET /api/v1/tontines/{id} inexistant retourne 404")
void getTontineById_inexistant_returns404() {
given()
@@ -84,7 +84,7 @@ class TontineResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "tontine_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "TONTINE_RESP" })
@DisplayName("GET /api/v1/tontines/{id} existant retourne 200")
void getTontineById_existant_returns200() {
given()
@@ -97,7 +97,7 @@ class TontineResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "tontine_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "TONTINE_RESP" })
@DisplayName("GET /api/v1/tontines/organisation/{id} retourne 200")
void getTontinesByOrganisation_returns200() {
given()
@@ -110,7 +110,7 @@ class TontineResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "tontine_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "TONTINE_RESP" })
@DisplayName("POST creerTontine avec organisation valide retourne 201")
void creerTontine_valid_returns201() {
String body = "{"
@@ -146,7 +146,7 @@ class TontineResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "tontine_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "TONTINE_RESP" })
@DisplayName("PATCH changerStatut sans query param statut retourne 400")
void changerStatut_sansStatut_returns400() {
given()
@@ -158,7 +158,7 @@ class TontineResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "tontine_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "TONTINE_RESP" })
@DisplayName("PATCH changerStatut avec statut valide et ID inexistant retourne 404")
void changerStatut_avecStatutValidEtIdInexistant_returns404() {
given()
@@ -171,7 +171,7 @@ class TontineResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "tontine_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "TONTINE_RESP" })
@DisplayName("POST creerTontine avec corps vide retourne 4xx")
void creerTontine_corpsVide_returns4xx() {
given()
@@ -184,7 +184,7 @@ class TontineResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "tontine_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "TONTINE_RESP" })
@DisplayName("PATCH changerStatut avec statut valide et ID existant retourne 200")
void changerStatut_avecStatutValidEtIdExistant_returns200() {
given()

View File

@@ -72,7 +72,7 @@ class CampagneVoteResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "vote_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "VOTE_RESP" })
@DisplayName("GET /api/v1/vote/campagnes/{id} inexistant retourne 404")
void getCampagneById_inexistant_returns404() {
given()
@@ -84,7 +84,7 @@ class CampagneVoteResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "vote_resp", "membre_actif" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "VOTE_RESP", "MEMBRE" })
@DisplayName("GET /api/v1/vote/campagnes/{id} existant retourne 200")
void getCampagneById_existant_returns200() {
given()
@@ -97,7 +97,7 @@ class CampagneVoteResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "vote_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "VOTE_RESP" })
@DisplayName("GET /api/v1/vote/campagnes/organisation/{id} retourne 200")
void getCampagnesByOrganisation_returns200() {
given()
@@ -110,7 +110,7 @@ class CampagneVoteResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "vote_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "VOTE_RESP" })
@DisplayName("PATCH changerStatut sans query param statut retourne 400")
void changerStatut_sansStatut_returns400() {
given()
@@ -122,7 +122,7 @@ class CampagneVoteResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "vote_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "VOTE_RESP" })
@DisplayName("PATCH changerStatut avec statut valide et ID inexistant retourne 404")
void changerStatut_avecStatutValidEtIdInexistant_returns404() {
given()
@@ -135,7 +135,7 @@ class CampagneVoteResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "vote_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "VOTE_RESP" })
@DisplayName("POST creerCampagne avec organisation valide retourne 201")
void creerCampagne_valid_returns201() {
String body = "{"
@@ -171,7 +171,7 @@ class CampagneVoteResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "vote_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "VOTE_RESP" })
@DisplayName("POST ajouterCandidat avec campagne valide retourne 201")
void ajouterCandidat_campagneValide_returns201() {
String body = "{"
@@ -189,7 +189,7 @@ class CampagneVoteResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "vote_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "VOTE_RESP" })
@DisplayName("PATCH changerStatut avec statut valide et ID existant retourne 200")
void changerStatut_avecStatutValidEtIdExistant_returns200() {
given()
@@ -203,7 +203,7 @@ class CampagneVoteResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "vote_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "VOTE_RESP" })
@DisplayName("POST creerCampagne avec corps vide retourne 400")
void creerCampagne_corpsVide_returns400() {
given()
@@ -216,7 +216,7 @@ class CampagneVoteResourceTest {
}
@Test
@TestSecurity(user = "admin@unionflow.com", roles = { "admin", "admin_organisation", "vote_resp" })
@TestSecurity(user = "admin@unionflow.com", roles = { "ADMIN", "ADMIN_ORGANISATION", "VOTE_RESP" })
@DisplayName("POST ajouterCandidat avec ID inexistant retourne 4xx")
void ajouterCandidat_idInexistant_returns4xx() {
given()

View File

@@ -319,7 +319,7 @@ class KeycloakServiceTest {
}
@Test
@TestSecurity(user = "admin@test.com", roles = {"admin"})
@TestSecurity(user = "admin@test.com", roles = {"ADMIN"})
@DisplayName("isAdmin avec rôle admin (minuscule) retourne true")
void isAdmin_adminLowercase_returnsTrue() {
assertThat(keycloakService.isAdmin()).isTrue();
@@ -490,14 +490,14 @@ class KeycloakServiceTest {
}
@Test
@TestSecurity(user = "tresorier@test.com", roles = {"tresorier"})
@TestSecurity(user = "tresorier@test.com", roles = {"TRESORIER"})
@DisplayName("canManageFinances avec rôle tresorier (minuscule) retourne true")
void canManageFinances_tresorierLowercase_returnsTrue() {
assertThat(keycloakService.canManageFinances()).isTrue();
}
@Test
@TestSecurity(user = "gestionnaire@test.com", roles = {"gestionnaire_membre"})
@TestSecurity(user = "gestionnaire@test.com", roles = {"GESTIONNAIRE_MEMBRE"})
@DisplayName("canManageMembers avec rôle gestionnaire_membre (minuscule) retourne true")
void canManageMembers_gestionnaireLowercase_returnsTrue() {
assertThat(keycloakService.canManageMembers()).isTrue();
@@ -518,70 +518,70 @@ class KeycloakServiceTest {
}
@Test
@TestSecurity(user = "organisateur@test.com", roles = {"organisateur_evenement"})
@TestSecurity(user = "organisateur@test.com", roles = {"ORGANISATEUR_EVENEMENT"})
@DisplayName("canManageEvents avec rôle organisateur_evenement (minuscule) retourne true")
void canManageEvents_organisateurLowercase_returnsTrue() {
assertThat(keycloakService.canManageEvents()).isTrue();
}
@Test
@TestSecurity(user = "president@test.com", roles = {"president"})
@TestSecurity(user = "president@test.com", roles = {"PRESIDENT"})
@DisplayName("canManageOrganizations avec rôle president (minuscule) retourne true")
void canManageOrganizations_presidentLowercase_returnsTrue() {
assertThat(keycloakService.canManageOrganizations()).isTrue();
}
@Test
@TestSecurity(user = "secretaire@test.com", roles = {"secretaire"})
@TestSecurity(user = "secretaire@test.com", roles = {"SECRETAIRE"})
@DisplayName("canManageMembers avec rôle secretaire (minuscule) retourne true")
void canManageMembers_secretaireLowercase_returnsTrue() {
assertThat(keycloakService.canManageMembers()).isTrue();
}
@Test
@TestSecurity(user = "secretaire@test.com", roles = {"secretaire"})
@TestSecurity(user = "secretaire@test.com", roles = {"SECRETAIRE"})
@DisplayName("canManageEvents avec rôle secretaire (minuscule) retourne true")
void canManageEvents_secretaireLowercase_returnsTrue() {
assertThat(keycloakService.canManageEvents()).isTrue();
}
@Test
@TestSecurity(user = "president@test.com", roles = {"president"})
@TestSecurity(user = "president@test.com", roles = {"PRESIDENT"})
@DisplayName("canManageFinances avec rôle president (minuscule) retourne true")
void canManageFinances_presidentLowercase_returnsTrue() {
assertThat(keycloakService.canManageFinances()).isTrue();
}
@Test
@TestSecurity(user = "president@test.com", roles = {"president"})
@TestSecurity(user = "president@test.com", roles = {"PRESIDENT"})
@DisplayName("canManageMembers avec rôle president (minuscule) retourne true")
void canManageMembers_presidentLowercase_returnsTrue() {
assertThat(keycloakService.canManageMembers()).isTrue();
}
@Test
@TestSecurity(user = "admin@test.com", roles = {"admin"})
@TestSecurity(user = "admin@test.com", roles = {"ADMIN"})
@DisplayName("canManageMembers avec rôle admin (minuscule) retourne true")
void canManageMembers_adminLowercase_returnsTrue() {
assertThat(keycloakService.canManageMembers()).isTrue();
}
@Test
@TestSecurity(user = "admin@test.com", roles = {"admin"})
@TestSecurity(user = "admin@test.com", roles = {"ADMIN"})
@DisplayName("canManageFinances avec rôle admin (minuscule) retourne true")
void canManageFinances_adminLowercase_returnsTrue() {
assertThat(keycloakService.canManageFinances()).isTrue();
}
@Test
@TestSecurity(user = "admin@test.com", roles = {"admin"})
@TestSecurity(user = "admin@test.com", roles = {"ADMIN"})
@DisplayName("canManageEvents avec rôle admin (minuscule) retourne true")
void canManageEvents_adminLowercase_returnsTrue() {
assertThat(keycloakService.canManageEvents()).isTrue();
}
@Test
@TestSecurity(user = "admin@test.com", roles = {"admin"})
@TestSecurity(user = "admin@test.com", roles = {"ADMIN"})
@DisplayName("canManageOrganizations avec rôle admin (minuscule) retourne true")
void canManageOrganizations_adminLowercase_returnsTrue() {
assertThat(keycloakService.canManageOrganizations()).isTrue();