test: corriger OrganisationSummaryResponseTest pour ville + pays (12 args)
Constructeur passé de 10 à 12 arguments avec l'ajout de ville et pays. Tests mis à jour + nouveau test testSettersVillePays.
This commit is contained in:
@@ -21,7 +21,9 @@ class OrganisationSummaryResponseTest {
|
||||
"Actif",
|
||||
"success",
|
||||
150,
|
||||
true
|
||||
true,
|
||||
"Abidjan",
|
||||
"Côte d'Ivoire"
|
||||
);
|
||||
|
||||
assertThat(response.getId()).isEqualTo(id);
|
||||
@@ -34,6 +36,8 @@ class OrganisationSummaryResponseTest {
|
||||
assertThat(response.getStatutSeverity()).isEqualTo("success");
|
||||
assertThat(response.getNombreMembres()).isEqualTo(150);
|
||||
assertThat(response.getActif()).isTrue();
|
||||
assertThat(response.getVille()).isEqualTo("Abidjan");
|
||||
assertThat(response.getPays()).isEqualTo("Côte d'Ivoire");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -41,11 +45,11 @@ class OrganisationSummaryResponseTest {
|
||||
UUID id = UUID.randomUUID();
|
||||
|
||||
OrganisationSummaryResponse response1 = new OrganisationSummaryResponse(
|
||||
id, "Org", "ORG", "TYPE", "Type", "ACTIF", "Actif", "success", 100, true
|
||||
id, "Org", "ORG", "TYPE", "Type", "ACTIF", "Actif", "success", 100, true, "Dakar", "Sénégal"
|
||||
);
|
||||
|
||||
OrganisationSummaryResponse response2 = new OrganisationSummaryResponse(
|
||||
id, "Org", "ORG", "TYPE", "Type", "ACTIF", "Actif", "success", 100, true
|
||||
id, "Org", "ORG", "TYPE", "Type", "ACTIF", "Actif", "success", 100, true, "Dakar", "Sénégal"
|
||||
);
|
||||
|
||||
assertThat(response1).isEqualTo(response2);
|
||||
@@ -56,7 +60,7 @@ class OrganisationSummaryResponseTest {
|
||||
void testToString() {
|
||||
OrganisationSummaryResponse response = new OrganisationSummaryResponse(
|
||||
UUID.randomUUID(), "Org", "ORG", "TYPE", "Type",
|
||||
"ACTIF", "Actif", "success", 100, true
|
||||
"ACTIF", "Actif", "success", 100, true, "Bamako", "Mali"
|
||||
);
|
||||
|
||||
String toString = response.toString();
|
||||
@@ -64,17 +68,31 @@ class OrganisationSummaryResponseTest {
|
||||
assertThat(toString).isNotNull();
|
||||
assertThat(toString).contains("OrganisationSummaryResponse");
|
||||
assertThat(toString).contains("Org");
|
||||
assertThat(toString).contains("Bamako");
|
||||
assertThat(toString).contains("Mali");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testWithNullValues() {
|
||||
OrganisationSummaryResponse response = new OrganisationSummaryResponse(
|
||||
UUID.randomUUID(), "Org", null, "TYPE", "Type",
|
||||
"ACTIF", "Actif", "success", null, false
|
||||
"ACTIF", "Actif", "success", null, false, null, null
|
||||
);
|
||||
|
||||
assertThat(response.getNomCourt()).isNull();
|
||||
assertThat(response.getNombreMembres()).isNull();
|
||||
assertThat(response.getActif()).isFalse();
|
||||
assertThat(response.getVille()).isNull();
|
||||
assertThat(response.getPays()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
void testSettersVillePays() {
|
||||
OrganisationSummaryResponse response = new OrganisationSummaryResponse();
|
||||
response.setVille("Ouagadougou");
|
||||
response.setPays("Burkina Faso");
|
||||
|
||||
assertThat(response.getVille()).isEqualTo("Ouagadougou");
|
||||
assertThat(response.getPays()).isEqualTo("Burkina Faso");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user