-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEAT ITEM-235-batch-alimenter-le-fichier-de-sauvegarde-csv
- ajout d'un TU pour la méthode ConstructHeaderCsv - ajout du début de l'algorithme d'alimentation du fichier csv
- Loading branch information
Showing
6 changed files
with
112 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
core/src/test/java/fr/abes/item/core/components/FichierSauvegardeSuppCsvTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package fr.abes.item.core.components; | ||
|
||
import com.opencsv.CSVWriter; | ||
import fr.abes.cbs.exception.ZoneException; | ||
import fr.abes.cbs.notices.Exemplaire; | ||
import fr.abes.cbs.notices.TYPE_NOTICE; | ||
import fr.abes.cbs.notices.Zone; | ||
import fr.abes.item.core.service.ReferenceService; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.boot.test.mock.mockito.MockBean; | ||
|
||
import java.util.List; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
@SpringBootTest(classes = {FichierSauvegardeSuppCsv.class}) | ||
class FichierSauvegardeSuppCsvTest { | ||
|
||
@Autowired | ||
private FichierSauvegardeSuppCsv fichierSauvegardeSuppCsv; | ||
|
||
@MockBean | ||
private ReferenceService referenceService; | ||
|
||
CSVWriter csvWriter; | ||
|
||
@Test | ||
void gererZones() throws ZoneException { | ||
List<String> listZoneSousZone = List.of("917$a;930$a;$c;$d;$e;$i;$j;$v;$2;$l;$k;991$a;915$a;$b;$f;955$a;$k;$4;920$a;$b;$c".split(";")); | ||
|
||
String resultat = ""; | ||
|
||
Exemplaire exemplaire1 = new Exemplaire(); | ||
exemplaire1.addZone("930", "$c", "test 930$c"); | ||
exemplaire1.addZone("930", "$d", "test 930$d"); | ||
exemplaire1.addZone("991", "$a", "test 930$a"); | ||
|
||
Zone zone1 = new Zone("917", TYPE_NOTICE.EXEMPLAIRE); | ||
|
||
assertEquals(listZoneSousZone, fichierSauvegardeSuppCsv.gererZones(listZoneSousZone, exemplaire1, resultat, null)); | ||
|
||
// Exemplaire exemplaire2 = new Exemplaire(); | ||
// exemplaire2.addZone("917", "$a", "test 917$a"); | ||
// exemplaire2.addZone("991", "$a", "test 930$a"); | ||
// exemplaire2.addZone("915", "$a", "test 915$a"); | ||
// exemplaire2.addZone("915", "$c", "test 915$c"); | ||
// | ||
// assertEquals(, exemplaire2.getListeZones()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters