fix(tests): replace record-style accessors with JavaBean getters
MembreDashboardServiceTest and OrganisationServiceTest used record accessor syntax (e.g. result.nom()) on DTO classes that were converted from records to @Data classes — now using getters (result.getNom()).
This commit is contained in:
@@ -169,16 +169,16 @@ class MembreDashboardServiceTest {
|
||||
MembreDashboardSyntheseResponse result = service.getDashboardData();
|
||||
|
||||
assertThat(result).isNotNull();
|
||||
assertThat(result.prenom()).isEqualTo("Alice");
|
||||
assertThat(result.nom()).isEqualTo("Dupont");
|
||||
assertThat(result.dateInscription()).isEqualTo(LocalDate.of(2024, 1, 15));
|
||||
assertThat(result.statutCotisations()).isEqualTo("À jour");
|
||||
assertThat(result.tauxCotisationsPerso()).isEqualTo(50); // 6000/12000*100
|
||||
assertThat(result.mesCotisationsPaiement()).isEqualByComparingTo("5000");
|
||||
assertThat(result.monSoldeEpargne()).isEqualByComparingTo("50000");
|
||||
assertThat(result.mesDemandesAide()).isEqualTo(0);
|
||||
assertThat(result.aidesEnCours()).isEqualTo(0);
|
||||
assertThat(result.tauxAidesApprouvees()).isNull();
|
||||
assertThat(result.getPrenom()).isEqualTo("Alice");
|
||||
assertThat(result.getNom()).isEqualTo("Dupont");
|
||||
assertThat(result.getDateInscription()).isEqualTo(LocalDate.of(2024, 1, 15));
|
||||
assertThat(result.getStatutCotisations()).isEqualTo("À jour");
|
||||
assertThat(result.getTauxCotisationsPerso()).isEqualTo(50); // 6000/12000*100
|
||||
assertThat(result.getMesCotisationsPaiement()).isEqualByComparingTo("5000");
|
||||
assertThat(result.getMonSoldeEpargne()).isEqualByComparingTo("50000");
|
||||
assertThat(result.getMesDemandesAide()).isEqualTo(0);
|
||||
assertThat(result.getAidesEnCours()).isEqualTo(0);
|
||||
assertThat(result.getTauxAidesApprouvees()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -206,8 +206,8 @@ class MembreDashboardServiceTest {
|
||||
|
||||
MembreDashboardSyntheseResponse result = service.getDashboardData();
|
||||
|
||||
assertThat(result.statutCotisations()).isEqualTo("En retard");
|
||||
assertThat(result.tauxCotisationsPerso()).isEqualTo(25); // 3000/12000*100
|
||||
assertThat(result.getStatutCotisations()).isEqualTo("En retard");
|
||||
assertThat(result.getTauxCotisationsPerso()).isEqualTo(25); // 3000/12000*100
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -239,7 +239,7 @@ class MembreDashboardServiceTest {
|
||||
|
||||
MembreDashboardSyntheseResponse result = service.getDashboardData();
|
||||
|
||||
assertThat(result.tauxCotisationsPerso()).isNull();
|
||||
assertThat(result.getTauxCotisationsPerso()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -270,7 +270,7 @@ class MembreDashboardServiceTest {
|
||||
MembreDashboardSyntheseResponse result = service.getDashboardData();
|
||||
|
||||
// 2 payées / 4 totales = 50%
|
||||
assertThat(result.tauxCotisationsPerso()).isEqualTo(50);
|
||||
assertThat(result.getTauxCotisationsPerso()).isEqualTo(50);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -300,7 +300,7 @@ class MembreDashboardServiceTest {
|
||||
|
||||
MembreDashboardSyntheseResponse result = service.getDashboardData();
|
||||
|
||||
assertThat(result.tauxCotisationsPerso()).isEqualTo(100);
|
||||
assertThat(result.getTauxCotisationsPerso()).isEqualTo(100);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -337,9 +337,9 @@ class MembreDashboardServiceTest {
|
||||
|
||||
MembreDashboardSyntheseResponse result = service.getDashboardData();
|
||||
|
||||
assertThat(result.mesDemandesAide()).isEqualTo(3);
|
||||
assertThat(result.aidesEnCours()).isEqualTo(1); // seulement EN_COURS_EXAMEN
|
||||
assertThat(result.tauxAidesApprouvees()).isEqualTo(33); // 1/3 * 100
|
||||
assertThat(result.getMesDemandesAide()).isEqualTo(3);
|
||||
assertThat(result.getAidesEnCours()).isEqualTo(1); // seulement EN_COURS_EXAMEN
|
||||
assertThat(result.getTauxAidesApprouvees()).isEqualTo(33); // 1/3 * 100
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -366,10 +366,10 @@ class MembreDashboardServiceTest {
|
||||
|
||||
MembreDashboardSyntheseResponse result = service.getDashboardData();
|
||||
|
||||
assertThat(result.mesDemandesAide()).isEqualTo(1);
|
||||
assertThat(result.getMesDemandesAide()).isEqualTo(1);
|
||||
// statut null → exclut du filtre aidesEnCours (condition: d.getStatut() != null && ...)
|
||||
assertThat(result.aidesEnCours()).isEqualTo(0);
|
||||
assertThat(result.tauxAidesApprouvees()).isEqualTo(0);
|
||||
assertThat(result.getAidesEnCours()).isEqualTo(0);
|
||||
assertThat(result.getTauxAidesApprouvees()).isEqualTo(0);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
@@ -401,8 +401,8 @@ class MembreDashboardServiceTest {
|
||||
|
||||
MembreDashboardSyntheseResponse result = service.getDashboardData();
|
||||
|
||||
assertThat(result.mesCotisationsPaiement()).isEqualByComparingTo(BigDecimal.ZERO);
|
||||
assertThat(result.totalCotisationsPayeesToutTemps()).isEqualByComparingTo(BigDecimal.ZERO);
|
||||
assertThat(result.getMesCotisationsPaiement()).isEqualByComparingTo(BigDecimal.ZERO);
|
||||
assertThat(result.getTotalCotisationsPayeesToutTemps()).isEqualByComparingTo(BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -425,7 +425,7 @@ class MembreDashboardServiceTest {
|
||||
|
||||
MembreDashboardSyntheseResponse result = service.getDashboardData();
|
||||
|
||||
assertThat(result.dateInscription()).isNull();
|
||||
assertThat(result.getDateInscription()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -478,8 +478,8 @@ class MembreDashboardServiceTest {
|
||||
|
||||
MembreDashboardSyntheseResponse result = service.getDashboardData();
|
||||
|
||||
assertThat(result.tauxCotisationsPerso()).isEqualTo(0);
|
||||
assertThat(result.totalCotisationsPayeesAnnee()).isEqualByComparingTo(BigDecimal.ZERO);
|
||||
assertThat(result.getTauxCotisationsPerso()).isEqualTo(0);
|
||||
assertThat(result.getTotalCotisationsPayeesAnnee()).isEqualByComparingTo(BigDecimal.ZERO);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -506,8 +506,8 @@ class MembreDashboardServiceTest {
|
||||
|
||||
MembreDashboardSyntheseResponse result = service.getDashboardData();
|
||||
|
||||
assertThat(result.mesDemandesAide()).isEqualTo(1);
|
||||
assertThat(result.aidesEnCours()).isEqualTo(0); // ANNULEE exclue
|
||||
assertThat(result.getMesDemandesAide()).isEqualTo(1);
|
||||
assertThat(result.getAidesEnCours()).isEqualTo(0); // ANNULEE exclue
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -539,10 +539,10 @@ class MembreDashboardServiceTest {
|
||||
MembreDashboardSyntheseResponse result = service.getDashboardData();
|
||||
|
||||
// EN_COURS_EVALUATION comptée + REJETEE non comptée → aidesEnCours = 1
|
||||
assertThat(result.aidesEnCours()).isEqualTo(1);
|
||||
assertThat(result.mesDemandesAide()).isEqualTo(2);
|
||||
assertThat(result.getAidesEnCours()).isEqualTo(1);
|
||||
assertThat(result.getMesDemandesAide()).isEqualTo(2);
|
||||
// 0 APPROUVEE / 2 total → tauxAidesApprouvees = 0
|
||||
assertThat(result.tauxAidesApprouvees()).isEqualTo(0);
|
||||
assertThat(result.getTauxAidesApprouvees()).isEqualTo(0);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -564,8 +564,8 @@ class MembreDashboardServiceTest {
|
||||
|
||||
MembreDashboardSyntheseResponse result = service.getDashboardData();
|
||||
|
||||
assertThat(result.mesDemandesAide()).isEqualTo(0);
|
||||
assertThat(result.aidesEnCours()).isEqualTo(0);
|
||||
assertThat(result.tauxAidesApprouvees()).isNull();
|
||||
assertThat(result.getMesDemandesAide()).isEqualTo(0);
|
||||
assertThat(result.getAidesEnCours()).isEqualTo(0);
|
||||
assertThat(result.getTauxAidesApprouvees()).isNull();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1076,7 +1076,7 @@ class OrganisationServiceTest {
|
||||
OrganisationSummaryResponse resp = organisationService.convertToSummaryResponse(org);
|
||||
|
||||
assertThat(resp).isNotNull();
|
||||
assertThat(resp.typeOrganisationLibelle()).isNull();
|
||||
assertThat(resp.getTypeOrganisationLibelle()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -1093,7 +1093,7 @@ class OrganisationServiceTest {
|
||||
|
||||
OrganisationSummaryResponse resp = organisationService.convertToSummaryResponse(org);
|
||||
|
||||
assertThat(resp.typeOrganisationLibelle()).isEqualTo("Coopérative");
|
||||
assertThat(resp.getTypeOrganisationLibelle()).isEqualTo("Coopérative");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -1108,7 +1108,7 @@ class OrganisationServiceTest {
|
||||
|
||||
OrganisationSummaryResponse resp = organisationService.convertToSummaryResponse(org);
|
||||
|
||||
assertThat(resp.typeOrganisationLibelle()).isEqualTo("UNKNOWN");
|
||||
assertThat(resp.getTypeOrganisationLibelle()).isEqualTo("UNKNOWN");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -1127,8 +1127,8 @@ class OrganisationServiceTest {
|
||||
|
||||
OrganisationSummaryResponse resp = organisationService.convertToSummaryResponse(org);
|
||||
|
||||
assertThat(resp.statutLibelle()).isEqualTo("Suspendue");
|
||||
assertThat(resp.statutSeverity()).isEqualTo("warning");
|
||||
assertThat(resp.getStatutLibelle()).isEqualTo("Suspendue");
|
||||
assertThat(resp.getStatutSeverity()).isEqualTo("warning");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -1143,8 +1143,8 @@ class OrganisationServiceTest {
|
||||
|
||||
OrganisationSummaryResponse resp = organisationService.convertToSummaryResponse(org);
|
||||
|
||||
assertThat(resp.statutLibelle()).isEqualTo("ACTIVE");
|
||||
assertThat(resp.statutSeverity()).isNull();
|
||||
assertThat(resp.getStatutLibelle()).isEqualTo("ACTIVE");
|
||||
assertThat(resp.getStatutSeverity()).isNull();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user