fix(dev): corriger config OIDC issuer + supprimer tables fantômes pré-consolidation
- application-dev.properties : token.issuer utilise ${DEV_HOST:localhost} pour valider
les JWT émis par Keycloak via l'IP LAN (mobile physique sur réseau local)
- .env : DEV_HOST=192.168.1.13 — source unique côté backend, en sync avec
android/local.properties → dev.host côté mobile
- V24 : suppression des 8 tables fantômes issues des migrations pré-consolidation
(document, permission, favori, ticket, suggestion, suggestion_vote, configuration,
role_permission) — toutes vides, les entités JPA pointaient déjà vers les tables
plurielles correctes. Les contraintes uk_role_permission et uk_suggestion_vote
sont maintenant sur les vraies tables (roles_permissions, suggestion_votes).
This commit is contained in:
4
.env
4
.env
@@ -1,3 +1,7 @@
|
||||
# IP LAN de la machine de dev (mobile physique sur réseau local)
|
||||
# Garder en sync avec android/local.properties → dev.host dans le projet mobile
|
||||
DEV_HOST=192.168.1.13
|
||||
|
||||
# Base de données (profil prod — en dev c'est DB_PASSWORD_DEV:skyfile qui est utilisé)
|
||||
DB_PASSWORD=skyfile
|
||||
|
||||
|
||||
@@ -31,6 +31,10 @@ quarkus.oidc.client-id=unionflow-server
|
||||
quarkus.oidc.token.audience=unionflow-server
|
||||
quarkus.oidc.credentials.secret=unionflow-secret-2025
|
||||
quarkus.oidc.tls.verification=none
|
||||
# Issuer dynamique — Keycloak émet iss=http://<IP_LAN>:8180/... quand le mobile
|
||||
# accède via le réseau local. DEV_HOST dans .env doit correspondre à l'IP de la machine.
|
||||
# Garder en sync avec android/local.properties → dev.host
|
||||
quarkus.oidc.token.issuer=http://${DEV_HOST:localhost}:8180/realms/unionflow
|
||||
|
||||
# OpenAPI — serveur dev
|
||||
quarkus.smallrye-openapi.servers=http://localhost:8085
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
-- V24 : Suppression des tables fantômes pré-consolidation
|
||||
-- Ces tables (noms singuliers) ont été créées par les anciennes migrations V1-V10 avant consolidation.
|
||||
-- Les entités JPA pointent vers les tables Flyway correctes (noms pluriels).
|
||||
-- Toutes ces tables ont 0 lignes — suppression sans perte de données.
|
||||
--
|
||||
-- Ordre respectant les FK internes :
|
||||
-- suggestion_vote → suggestion
|
||||
-- role_permission → permission
|
||||
-- puis les tables autonomes
|
||||
|
||||
-- 1. Tables avec FK sortantes
|
||||
DROP TABLE IF EXISTS suggestion_vote;
|
||||
DROP TABLE IF EXISTS role_permission;
|
||||
|
||||
-- 2. Tables autonomes ou FK vers vraies tables (utilisateurs, organisations, roles)
|
||||
DROP TABLE IF EXISTS document;
|
||||
DROP TABLE IF EXISTS favori;
|
||||
DROP TABLE IF EXISTS ticket;
|
||||
DROP TABLE IF EXISTS suggestion;
|
||||
DROP TABLE IF EXISTS permission;
|
||||
DROP TABLE IF EXISTS configuration;
|
||||
@@ -63,9 +63,9 @@ class ConversationResourceTest {
|
||||
.type(ConversationType.GROUP)
|
||||
.participantIds(List.of(UUID.fromString(MEMBRE_ID)))
|
||||
.unreadCount(0)
|
||||
.isMuted(false)
|
||||
.isPinned(false)
|
||||
.isArchived(false)
|
||||
.muted(false)
|
||||
.pinned(false)
|
||||
.archived(false)
|
||||
.createdAt(LocalDateTime.now())
|
||||
.updatedAt(LocalDateTime.now())
|
||||
.build();
|
||||
|
||||
@@ -68,8 +68,8 @@ class MessageResourceTest {
|
||||
.type(MessageType.INDIVIDUAL)
|
||||
.status(MessageStatus.SENT)
|
||||
.priority(MessagePriority.NORMAL)
|
||||
.isEdited(false)
|
||||
.isDeleted(false)
|
||||
.edited(false)
|
||||
.deleted(false)
|
||||
.createdAt(LocalDateTime.now())
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ class CompteAdherentServiceLambdaCoverageTest {
|
||||
|
||||
// Le mo null a été filtré → orgNom = null (aucun mo valide)
|
||||
assertThat(response).isNotNull();
|
||||
assertThat(response.organisationNom()).isNull();
|
||||
assertThat(response.getOrganisationNom()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -122,7 +122,7 @@ class CompteAdherentServiceLambdaCoverageTest {
|
||||
|
||||
// Le mo avec org null a été filtré → orgNom = null (aucun mo avec org valide)
|
||||
assertThat(response).isNotNull();
|
||||
assertThat(response.organisationNom()).isNull();
|
||||
assertThat(response.getOrganisationNom()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -157,7 +157,7 @@ class CompteAdherentServiceLambdaCoverageTest {
|
||||
|
||||
// Seul moAvecOrg passe le filtre lambda$3 → orgNom = "Organisation Lambda3 Test"
|
||||
assertThat(response).isNotNull();
|
||||
assertThat(response.organisationNom()).isEqualTo("Organisation Lambda3 Test");
|
||||
assertThat(response.getOrganisationNom()).isEqualTo("Organisation Lambda3 Test");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -173,7 +173,7 @@ class CompteAdherentServiceLambdaCoverageTest {
|
||||
CompteAdherentResponse response = service.getMonCompte();
|
||||
|
||||
assertThat(response).isNotNull();
|
||||
assertThat(response.nomComplet()).isEmpty();
|
||||
assertThat(response.getNomComplet()).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -189,7 +189,7 @@ class CompteAdherentServiceLambdaCoverageTest {
|
||||
CompteAdherentResponse response = service.getMonCompte();
|
||||
|
||||
assertThat(response).isNotNull();
|
||||
assertThat(response.nomComplet()).isEqualTo("Diallo");
|
||||
assertThat(response.getNomComplet()).isEqualTo("Diallo");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -204,7 +204,7 @@ class CompteAdherentServiceLambdaCoverageTest {
|
||||
CompteAdherentResponse response = service.getMonCompte();
|
||||
|
||||
assertThat(response).isNotNull();
|
||||
assertThat(response.dateAdhesion()).isEqualTo(java.time.LocalDate.of(2022, 3, 15));
|
||||
assertThat(response.getDateAdhesion()).isEqualTo(java.time.LocalDate.of(2022, 3, 15));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -218,7 +218,7 @@ class CompteAdherentServiceLambdaCoverageTest {
|
||||
CompteAdherentResponse response = service.getMonCompte();
|
||||
|
||||
assertThat(response).isNotNull();
|
||||
assertThat(response.organisationNom()).isNull();
|
||||
assertThat(response.getOrganisationNom()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -232,6 +232,6 @@ class CompteAdherentServiceLambdaCoverageTest {
|
||||
CompteAdherentResponse response = service.getMonCompte();
|
||||
|
||||
assertThat(response).isNotNull();
|
||||
assertThat(response.organisationNom()).isNull();
|
||||
assertThat(response.getOrganisationNom()).isNull();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,16 +109,16 @@ class CompteAdherentServiceTest {
|
||||
|
||||
// THEN
|
||||
assertThat(response).isNotNull();
|
||||
assertThat(response.numeroMembre()).isEqualTo("MBR-001");
|
||||
|
||||
assertThat(response.getNumeroMembre()).isEqualTo("MBR-001");
|
||||
|
||||
// soldeTotalDisponible = 50.000 (cotis) + (100.000 - 20.000) (épargne dispo) = 130.000
|
||||
assertThat(response.soldeTotalDisponible()).isEqualByComparingTo(new BigDecimal("130000"));
|
||||
|
||||
assertThat(response.getSoldeTotalDisponible()).isEqualByComparingTo(new BigDecimal("130000"));
|
||||
|
||||
// capaciteEmprunt = 3 * 80.000 = 240.000
|
||||
assertThat(response.capaciteEmprunt()).isEqualByComparingTo(new BigDecimal("240000"));
|
||||
|
||||
assertThat(response.encoursCreditTotal()).isEqualByComparingTo(new BigDecimal("30000"));
|
||||
assertThat(response.tauxEngagement()).isEqualTo(100);
|
||||
assertThat(response.getCapaciteEmprunt()).isEqualByComparingTo(new BigDecimal("240000"));
|
||||
|
||||
assertThat(response.getEncoursCreditTotal()).isEqualByComparingTo(new BigDecimal("30000"));
|
||||
assertThat(response.getTauxEngagement()).isEqualTo(100);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -157,7 +157,7 @@ class CompteAdherentServiceTest {
|
||||
|
||||
// THEN – lambda$0 a été traversé, membre trouvé via fallback
|
||||
assertThat(response).isNotNull();
|
||||
assertThat(response.numeroMembre()).isEqualTo("MBR-OR-001");
|
||||
assertThat(response.getNumeroMembre()).isEqualTo("MBR-OR-001");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -207,12 +207,12 @@ class CompteAdherentServiceTest {
|
||||
|
||||
// THEN — nvl() a retourné ZERO pour toutes les valeurs null
|
||||
assertThat(response).isNotNull();
|
||||
assertThat(response.soldeCotisations()).isEqualByComparingTo(java.math.BigDecimal.ZERO);
|
||||
assertThat(response.soldeEpargne()).isEqualByComparingTo(java.math.BigDecimal.ZERO);
|
||||
assertThat(response.soldeBloque()).isEqualByComparingTo(java.math.BigDecimal.ZERO);
|
||||
assertThat(response.encoursCreditTotal()).isEqualByComparingTo(java.math.BigDecimal.ZERO);
|
||||
assertThat(response.soldeTotalDisponible()).isEqualByComparingTo(java.math.BigDecimal.ZERO);
|
||||
assertThat(response.capaciteEmprunt()).isEqualByComparingTo(java.math.BigDecimal.ZERO);
|
||||
assertThat(response.getSoldeCotisations()).isEqualByComparingTo(java.math.BigDecimal.ZERO);
|
||||
assertThat(response.getSoldeEpargne()).isEqualByComparingTo(java.math.BigDecimal.ZERO);
|
||||
assertThat(response.getSoldeBloque()).isEqualByComparingTo(java.math.BigDecimal.ZERO);
|
||||
assertThat(response.getEncoursCreditTotal()).isEqualByComparingTo(java.math.BigDecimal.ZERO);
|
||||
assertThat(response.getSoldeTotalDisponible()).isEqualByComparingTo(java.math.BigDecimal.ZERO);
|
||||
assertThat(response.getCapaciteEmprunt()).isEqualByComparingTo(java.math.BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -267,7 +267,7 @@ class CompteAdherentServiceTest {
|
||||
|
||||
// THEN — nbTotal == 0 → tauxEngagement == null (branche if else non exécutée)
|
||||
assertThat(response).isNotNull();
|
||||
assertThat(response.tauxEngagement()).isNull();
|
||||
assertThat(response.getTauxEngagement()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -311,7 +311,7 @@ class CompteAdherentServiceTest {
|
||||
|
||||
// THEN – lambdas $3 (filter non-null), $4 (filter isActif), $5 (map nom) tous traversés
|
||||
assertThat(response).isNotNull();
|
||||
assertThat(response.organisationNom()).isEqualTo("Organisation Test Coverage");
|
||||
assertThat(response.getOrganisationNom()).isEqualTo("Organisation Test Coverage");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -361,7 +361,7 @@ class CompteAdherentServiceTest {
|
||||
CompteAdherentResponse response = service.getMonCompte();
|
||||
|
||||
// L'organisation la plus récente (2023) doit être sélectionnée
|
||||
assertThat(response.organisationNom()).isEqualTo("Org Récente");
|
||||
assertThat(response.getOrganisationNom()).isEqualTo("Org Récente");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -410,7 +410,7 @@ class CompteAdherentServiceTest {
|
||||
CompteAdherentResponse response = service.getMonCompte();
|
||||
|
||||
// mo2 avec 2024 > LocalDate.MIN → org2 sélectionnée
|
||||
assertThat(response.organisationNom()).isEqualTo("Org Avec Date");
|
||||
assertThat(response.getOrganisationNom()).isEqualTo("Org Avec Date");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -144,9 +144,9 @@ class ConversationServiceTest {
|
||||
|
||||
assertThat(result).hasSize(1);
|
||||
ConversationResponse response = result.get(0);
|
||||
assertThat(response.lastMessage()).isNotNull();
|
||||
assertThat(response.lastMessage().content()).isEqualTo("Hello");
|
||||
assertThat(response.unreadCount()).isEqualTo(3);
|
||||
assertThat(response.getLastMessage()).isNotNull();
|
||||
assertThat(response.getLastMessage().getContent()).isEqualTo("Hello");
|
||||
assertThat(response.getUnreadCount()).isEqualTo(3);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -179,8 +179,8 @@ class ConversationServiceTest {
|
||||
ConversationResponse response = conversationService.getConversationById(conv.getId(), membreId);
|
||||
|
||||
assertThat(response).isNotNull();
|
||||
assertThat(response.id()).isEqualTo(conv.getId());
|
||||
assertThat(response.name()).isEqualTo("Test Conv");
|
||||
assertThat(response.getId()).isEqualTo(conv.getId());
|
||||
assertThat(response.getName()).isEqualTo("Test Conv");
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -209,7 +209,7 @@ class ConversationServiceTest {
|
||||
ConversationResponse response = conversationService.createConversation(request, creatorId);
|
||||
|
||||
assertThat(response).isNotNull();
|
||||
assertThat(response.name()).isEqualTo("New Conv");
|
||||
assertThat(response.getName()).isEqualTo("New Conv");
|
||||
verify(conversationRepository).persist(any(Conversation.class));
|
||||
verify(entityManager, never()).find(eq(Organisation.class), any());
|
||||
}
|
||||
@@ -240,7 +240,7 @@ class ConversationServiceTest {
|
||||
ConversationResponse response = conversationService.createConversation(request, creatorId);
|
||||
|
||||
assertThat(response).isNotNull();
|
||||
assertThat(response.organisationId()).isEqualTo(orgId);
|
||||
assertThat(response.getOrganisationId()).isEqualTo(orgId);
|
||||
verify(entityManager).find(Organisation.class, orgId);
|
||||
}
|
||||
|
||||
@@ -270,8 +270,8 @@ class ConversationServiceTest {
|
||||
ConversationResponse response = conversationService.createConversation(request, creatorId);
|
||||
|
||||
// Creator + participant1 = 2 participants
|
||||
assertThat(response.participantIds()).hasSize(2);
|
||||
assertThat(response.participantIds()).contains(creatorId, participant1Id);
|
||||
assertThat(response.getParticipantIds()).hasSize(2);
|
||||
assertThat(response.getParticipantIds()).contains(creatorId, participant1Id);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -297,8 +297,8 @@ class ConversationServiceTest {
|
||||
ConversationResponse response = conversationService.createConversation(request, creatorId);
|
||||
|
||||
// Le créateur ne doit pas être dupliqué
|
||||
assertThat(response.participantIds()).hasSize(1);
|
||||
assertThat(response.participantIds()).containsExactly(creatorId);
|
||||
assertThat(response.getParticipantIds()).hasSize(1);
|
||||
assertThat(response.getParticipantIds()).containsExactly(creatorId);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -324,8 +324,8 @@ class ConversationServiceTest {
|
||||
ConversationResponse response = conversationService.createConversation(request, creatorId);
|
||||
|
||||
// unknownId est filtré, seul le créateur reste
|
||||
assertThat(response.participantIds()).hasSize(1);
|
||||
assertThat(response.participantIds()).containsExactly(creatorId);
|
||||
assertThat(response.getParticipantIds()).hasSize(1);
|
||||
assertThat(response.getParticipantIds()).containsExactly(creatorId);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -350,7 +350,7 @@ class ConversationServiceTest {
|
||||
|
||||
assertThat(response).isNotNull();
|
||||
// Aucun participant car creator introuvable et liste vide
|
||||
assertThat(response.participantIds()).isEmpty();
|
||||
assertThat(response.getParticipantIds()).isEmpty();
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -539,10 +539,10 @@ class ConversationServiceTest {
|
||||
|
||||
ConversationResponse response = conversationService.getConversationById(conv.getId(), membreId);
|
||||
|
||||
assertThat(response.lastMessage()).isNotNull();
|
||||
assertThat(response.lastMessage().content()).isEqualTo("Dernier message");
|
||||
assertThat(response.lastMessage().id()).isEqualTo(lastMsg.getId());
|
||||
assertThat(response.lastMessage().senderId()).isEqualTo(lastMsg.getSender().getId());
|
||||
assertThat(response.getLastMessage()).isNotNull();
|
||||
assertThat(response.getLastMessage().getContent()).isEqualTo("Dernier message");
|
||||
assertThat(response.getLastMessage().getId()).isEqualTo(lastMsg.getId());
|
||||
assertThat(response.getLastMessage().getSenderId()).isEqualTo(lastMsg.getSender().getId());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -557,6 +557,6 @@ class ConversationServiceTest {
|
||||
|
||||
ConversationResponse response = conversationService.getConversationById(conv.getId(), membreId);
|
||||
|
||||
assertThat(response.lastMessage()).isNull();
|
||||
assertThat(response.getLastMessage()).isNull();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ class MembreServiceAdvancedSearchTest {
|
||||
assertThat(result).isNotNull();
|
||||
assertThat(result.getTotalElements()).isGreaterThanOrEqualTo(1);
|
||||
assertThat(result.getMembres()).hasSizeGreaterThanOrEqualTo(1);
|
||||
assertThat(result.getMembres().get(0).prenom()).isEqualToIgnoringCase("Marie");
|
||||
assertThat(result.getMembres().get(0).getPrenom()).isEqualToIgnoringCase("Marie");
|
||||
assertThat(result.isFirst()).isTrue();
|
||||
assertThat(result.isLast()).isTrue();
|
||||
}
|
||||
@@ -221,7 +221,7 @@ class MembreServiceAdvancedSearchTest {
|
||||
assertThat(result.getTotalElements()).isGreaterThanOrEqualTo(3); // Au moins 3 membres actifs créés dans le setup
|
||||
assertThat(result.getMembres()).hasSizeGreaterThanOrEqualTo(3);
|
||||
assertThat(result.getMembres())
|
||||
.allMatch(membre -> membre.statutCompte() != null && membre.statutCompte().equals("ACTIF"));
|
||||
.allMatch(membre -> membre.getStatutCompte() != null && membre.getStatutCompte().equals("ACTIF"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -275,7 +275,7 @@ class MembreServiceAdvancedSearchTest {
|
||||
assertThat(result).isNotNull();
|
||||
assertThat(result.getTotalElements()).isGreaterThanOrEqualTo(1);
|
||||
assertThat(result.getMembres()).hasSizeGreaterThanOrEqualTo(1);
|
||||
assertThat(result.getMembres().get(0).email()).contains("@unionflow.com");
|
||||
assertThat(result.getMembres().get(0).getEmail()).contains("@unionflow.com");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -297,7 +297,7 @@ class MembreServiceAdvancedSearchTest {
|
||||
.getMembres()
|
||||
.forEach(
|
||||
membre -> {
|
||||
assertThat(membre.roles())
|
||||
assertThat(membre.getRoles())
|
||||
.satisfiesAnyOf(
|
||||
roles -> assertThat(roles.contains("PRESIDENT")).isTrue(),
|
||||
roles -> assertThat(roles.contains("SECRETAIRE")).isTrue());
|
||||
|
||||
@@ -287,8 +287,8 @@ class MembreServiceExportAndSummaryTest {
|
||||
|
||||
assertThat(resp).isNotNull();
|
||||
// Branche mo.getOrganisation() != null → true → organisationId et organisationNom remplis
|
||||
assertThat(resp.organisationId()).isEqualTo(orgId);
|
||||
assertThat(resp.organisationNom()).isEqualTo("Lions Club Dakar");
|
||||
assertThat(resp.getOrganisationId()).isEqualTo(orgId);
|
||||
assertThat(resp.getOrganisationNom()).isEqualTo("Lions Club Dakar");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -307,8 +307,8 @@ class MembreServiceExportAndSummaryTest {
|
||||
|
||||
assertThat(resp).isNotNull();
|
||||
// Branche false → organisationId et organisationNom restent null
|
||||
assertThat(resp.organisationId()).isNull();
|
||||
assertThat(resp.organisationNom()).isNull();
|
||||
assertThat(resp.getOrganisationId()).isNull();
|
||||
assertThat(resp.getOrganisationNom()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -323,8 +323,8 @@ class MembreServiceExportAndSummaryTest {
|
||||
membreService.convertToSummaryResponse(membre);
|
||||
|
||||
assertThat(resp).isNotNull();
|
||||
assertThat(resp.organisationId()).isNull();
|
||||
assertThat(resp.organisationNom()).isNull();
|
||||
assertThat(resp.getOrganisationId()).isNull();
|
||||
assertThat(resp.getOrganisationNom()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -339,7 +339,7 @@ class MembreServiceExportAndSummaryTest {
|
||||
membreService.convertToSummaryResponse(membre);
|
||||
|
||||
assertThat(resp).isNotNull();
|
||||
assertThat(resp.organisationId()).isNull();
|
||||
assertThat(resp.getOrganisationId()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -359,7 +359,7 @@ class MembreServiceExportAndSummaryTest {
|
||||
dev.lions.unionflow.server.api.dto.membre.response.MembreSummaryResponse resp =
|
||||
membreService.convertToSummaryResponse(membre);
|
||||
|
||||
assertThat(resp.roles()).contains("SECRETAIRE");
|
||||
assertThat(resp.getRoles()).contains("SECRETAIRE");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -376,7 +376,7 @@ class MembreServiceExportAndSummaryTest {
|
||||
dev.lions.unionflow.server.api.dto.membre.response.MembreSummaryResponse resp =
|
||||
membreService.convertToSummaryResponse(membre);
|
||||
|
||||
assertThat(resp.roles()).isEmpty();
|
||||
assertThat(resp.getRoles()).isEmpty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -988,9 +988,9 @@ class MembreServiceTest {
|
||||
MembreSummaryResponse resp = membreService.convertToSummaryResponse(m);
|
||||
|
||||
assertThat(resp).isNotNull();
|
||||
assertThat(resp.roles()).isEmpty();
|
||||
assertThat(resp.statutCompteLibelle()).isNull();
|
||||
assertThat(resp.statutCompteSeverity()).isNull();
|
||||
assertThat(resp.getRoles()).isEmpty();
|
||||
assertThat(resp.getStatutCompteLibelle()).isNull();
|
||||
assertThat(resp.getStatutCompteSeverity()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -1008,8 +1008,8 @@ class MembreServiceTest {
|
||||
|
||||
MembreSummaryResponse resp = membreService.convertToSummaryResponse(m);
|
||||
|
||||
assertThat(resp.statutCompteLibelle()).isEqualTo("Actif");
|
||||
assertThat(resp.statutCompteSeverity()).isEqualTo("success");
|
||||
assertThat(resp.getStatutCompteLibelle()).isEqualTo("Actif");
|
||||
assertThat(resp.getStatutCompteSeverity()).isEqualTo("success");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -1027,7 +1027,7 @@ class MembreServiceTest {
|
||||
|
||||
MembreSummaryResponse resp = membreService.convertToSummaryResponse(m);
|
||||
|
||||
assertThat(resp.roles()).contains("TRESORIER");
|
||||
assertThat(resp.getRoles()).contains("TRESORIER");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -1049,8 +1049,8 @@ class MembreServiceTest {
|
||||
|
||||
MembreSummaryResponse resp = membreService.convertToSummaryResponse(m);
|
||||
|
||||
assertThat(resp.organisationId()).isEqualTo(orgId);
|
||||
assertThat(resp.organisationNom()).isEqualTo("Assoc Test");
|
||||
assertThat(resp.getOrganisationId()).isEqualTo(orgId);
|
||||
assertThat(resp.getOrganisationNom()).isEqualTo("Assoc Test");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -1067,7 +1067,7 @@ class MembreServiceTest {
|
||||
|
||||
MembreSummaryResponse resp = membreService.convertToSummaryResponse(m);
|
||||
|
||||
assertThat(resp.organisationId()).isNull();
|
||||
assertThat(resp.getOrganisationId()).isNull();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ class MessageServiceTest {
|
||||
List<MessageResponse> result = messageService.getMessages(conv.getId(), membreId, 20);
|
||||
|
||||
assertThat(result).hasSize(1);
|
||||
assertThat(result.get(0).content()).isEqualTo("Hello");
|
||||
assertThat(result.get(0).getContent()).isEqualTo("Hello");
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -189,10 +189,10 @@ class MessageServiceTest {
|
||||
MessageResponse response = messageService.sendMessage(request, senderId);
|
||||
|
||||
assertThat(response).isNotNull();
|
||||
assertThat(response.content()).isEqualTo("Bonjour");
|
||||
assertThat(response.type()).isEqualTo(MessageType.INDIVIDUAL);
|
||||
assertThat(response.priority()).isEqualTo(MessagePriority.NORMAL);
|
||||
assertThat(response.senderName()).isEqualTo("Jean Dupont");
|
||||
assertThat(response.getContent()).isEqualTo("Bonjour");
|
||||
assertThat(response.getType()).isEqualTo(MessageType.INDIVIDUAL);
|
||||
assertThat(response.getPriority()).isEqualTo(MessagePriority.NORMAL);
|
||||
assertThat(response.getSenderName()).isEqualTo("Jean Dupont");
|
||||
verify(messageRepository).persist(any(Message.class));
|
||||
verify(conversationRepository).persist(conv);
|
||||
}
|
||||
@@ -219,8 +219,8 @@ class MessageServiceTest {
|
||||
|
||||
MessageResponse response = messageService.sendMessage(request, senderId);
|
||||
|
||||
assertThat(response.type()).isEqualTo(MessageType.BROADCAST);
|
||||
assertThat(response.priority()).isEqualTo(MessagePriority.HIGH);
|
||||
assertThat(response.getType()).isEqualTo(MessageType.BROADCAST);
|
||||
assertThat(response.getPriority()).isEqualTo(MessagePriority.HIGH);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -247,8 +247,8 @@ class MessageServiceTest {
|
||||
|
||||
MessageResponse response = messageService.sendMessage(request, senderId);
|
||||
|
||||
assertThat(response.recipientIds()).isNotNull();
|
||||
assertThat(response.recipientIds()).containsExactlyInAnyOrder(recipient1, recipient2);
|
||||
assertThat(response.getRecipientIds()).isNotNull();
|
||||
assertThat(response.getRecipientIds()).containsExactlyInAnyOrder(recipient1, recipient2);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -273,8 +273,8 @@ class MessageServiceTest {
|
||||
|
||||
MessageResponse response = messageService.sendMessage(request, senderId);
|
||||
|
||||
assertThat(response.recipientRoles()).isNotNull();
|
||||
assertThat(response.recipientRoles()).containsExactly("ADMIN", "TRESORIER");
|
||||
assertThat(response.getRecipientRoles()).isNotNull();
|
||||
assertThat(response.getRecipientRoles()).containsExactly("ADMIN", "TRESORIER");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -299,8 +299,8 @@ class MessageServiceTest {
|
||||
|
||||
MessageResponse response = messageService.sendMessage(request, senderId);
|
||||
|
||||
assertThat(response.attachments()).isNotNull();
|
||||
assertThat(response.attachments()).containsExactly(
|
||||
assertThat(response.getAttachments()).isNotNull();
|
||||
assertThat(response.getAttachments()).containsExactly(
|
||||
"https://cdn.example.com/doc1.pdf",
|
||||
"https://cdn.example.com/img1.png"
|
||||
);
|
||||
@@ -328,9 +328,9 @@ class MessageServiceTest {
|
||||
|
||||
MessageResponse response = messageService.sendMessage(request, senderId);
|
||||
|
||||
assertThat(response.recipientIds()).isNull();
|
||||
assertThat(response.recipientRoles()).isNull();
|
||||
assertThat(response.attachments()).isNull();
|
||||
assertThat(response.getRecipientIds()).isNull();
|
||||
assertThat(response.getRecipientRoles()).isNull();
|
||||
assertThat(response.getAttachments()).isNull();
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -379,7 +379,7 @@ class MessageServiceTest {
|
||||
assertThat(msg.getIsEdited()).isTrue();
|
||||
assertThat(msg.getEditedAt()).isNotNull();
|
||||
verify(messageRepository).persist(msg);
|
||||
assertThat(response.content()).isEqualTo("Contenu édité");
|
||||
assertThat(response.getContent()).isEqualTo("Contenu édité");
|
||||
assertThat(response.isEdited()).isTrue();
|
||||
}
|
||||
|
||||
@@ -453,7 +453,7 @@ class MessageServiceTest {
|
||||
List<MessageResponse> result = messageService.getMessages(conv.getId(), membreId, 20);
|
||||
|
||||
assertThat(result).hasSize(1);
|
||||
assertThat(result.get(0).recipientIds()).containsExactlyInAnyOrder(r1, r2);
|
||||
assertThat(result.get(0).getRecipientIds()).containsExactlyInAnyOrder(r1, r2);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -471,7 +471,7 @@ class MessageServiceTest {
|
||||
|
||||
List<MessageResponse> result = messageService.getMessages(conv.getId(), membreId, 20);
|
||||
|
||||
assertThat(result.get(0).recipientRoles()).containsExactly("ADMIN", "SECRETAIRE");
|
||||
assertThat(result.get(0).getRecipientRoles()).containsExactly("ADMIN", "SECRETAIRE");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -489,7 +489,7 @@ class MessageServiceTest {
|
||||
|
||||
List<MessageResponse> result = messageService.getMessages(conv.getId(), membreId, 20);
|
||||
|
||||
assertThat(result.get(0).attachments()).containsExactly(
|
||||
assertThat(result.get(0).getAttachments()).containsExactly(
|
||||
"https://cdn.example.com/a.pdf",
|
||||
"https://cdn.example.com/b.png"
|
||||
);
|
||||
@@ -511,9 +511,9 @@ class MessageServiceTest {
|
||||
List<MessageResponse> result = messageService.getMessages(conv.getId(), membreId, 20);
|
||||
|
||||
MessageResponse response = result.get(0);
|
||||
assertThat(response.recipientIds()).isNull();
|
||||
assertThat(response.recipientRoles()).isNull();
|
||||
assertThat(response.attachments()).isNull();
|
||||
assertThat(response.getRecipientIds()).isNull();
|
||||
assertThat(response.getRecipientRoles()).isNull();
|
||||
assertThat(response.getAttachments()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -535,7 +535,7 @@ class MessageServiceTest {
|
||||
|
||||
List<MessageResponse> result = messageService.getMessages(conv.getId(), membreId, 20);
|
||||
|
||||
assertThat(result.get(0).organisationId()).isEqualTo(orgId);
|
||||
assertThat(result.get(0).getOrganisationId()).isEqualTo(orgId);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -554,7 +554,7 @@ class MessageServiceTest {
|
||||
|
||||
List<MessageResponse> result = messageService.getMessages(conv.getId(), membreId, 20);
|
||||
|
||||
assertThat(result.get(0).organisationId()).isNull();
|
||||
assertThat(result.get(0).getOrganisationId()).isNull();
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -580,7 +580,7 @@ class MessageServiceTest {
|
||||
|
||||
List<MessageResponse> result = messageService.getMessages(conv.getId(), membreId, 20);
|
||||
|
||||
assertThat(result.get(0).recipientIds()).isNull();
|
||||
assertThat(result.get(0).getRecipientIds()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -598,7 +598,7 @@ class MessageServiceTest {
|
||||
|
||||
List<MessageResponse> result = messageService.getMessages(conv.getId(), membreId, 20);
|
||||
|
||||
assertThat(result.get(0).recipientRoles()).isNull();
|
||||
assertThat(result.get(0).getRecipientRoles()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -616,6 +616,6 @@ class MessageServiceTest {
|
||||
|
||||
List<MessageResponse> result = messageService.getMessages(conv.getId(), membreId, 20);
|
||||
|
||||
assertThat(result.get(0).attachments()).isNull();
|
||||
assertThat(result.get(0).getAttachments()).isNull();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -530,7 +530,7 @@ class PaiementServiceTest {
|
||||
List<PaiementSummaryResponse> results = paiementService.getMonHistoriquePaiements(5);
|
||||
|
||||
assertThat(results).isNotNull().isNotEmpty();
|
||||
assertThat(results.get(0).statutPaiement()).isEqualTo("VALIDE");
|
||||
assertThat(results.get(0).getStatutPaiement()).isEqualTo("VALIDE");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user