Skip to content

Commit

Permalink
fix: test batch mode for siera business test
Browse files Browse the repository at this point in the history
  • Loading branch information
Nolife999 committed Nov 25, 2023
1 parent af8ea08 commit 8c7509c
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,28 +101,31 @@ private void executeTestSirene(String sandbox, String repertoire) throws IOExcep
private void executeTestSiera(String sandbox, String repertoire) throws IOException, ArcException, SQLException {
BddPatcherTest.insertTestDataSiera();

ApiServiceFactory.getService(TraitementPhase.INITIALISATION, sandbox, repertoire, 10000000, null).invokeApi();
// to test batch mode
String batchMode="1";

ApiServiceFactory.getService(TraitementPhase.INITIALISATION, sandbox, repertoire, 10000000, batchMode).invokeApi();

String repertoireDeDepot = DirectoryPath.directoryReceptionEntrepot(repertoire, sandbox,
DataWarehouse.DEFAULT.getName());

Files.copy(this.getClass().getClassLoader().getResourceAsStream("testFiles/siera_ano.xml"),
new File(repertoireDeDepot, "siera_ano.xml").toPath());

ApiServiceFactory.getService(TraitementPhase.RECEPTION, sandbox, repertoire, 10000000, null).invokeApi();
ApiServiceFactory.getService(TraitementPhase.RECEPTION, sandbox, repertoire, 10000000, batchMode).invokeApi();

assertEquals(1, nbFileInPhase(sandbox, TraitementPhase.RECEPTION, TraitementEtat.OK));

ApiServiceFactory.getService(TraitementPhase.CHARGEMENT, sandbox, repertoire, 10000000, null).invokeApi();
ApiServiceFactory.getService(TraitementPhase.CHARGEMENT, sandbox, repertoire, 10000000, batchMode).invokeApi();
assertEquals(1, nbFileInPhase(sandbox, TraitementPhase.CHARGEMENT, TraitementEtat.OK));

ApiServiceFactory.getService(TraitementPhase.NORMAGE, sandbox, repertoire, 10000000, null).invokeApi();
ApiServiceFactory.getService(TraitementPhase.NORMAGE, sandbox, repertoire, 10000000, batchMode).invokeApi();
assertEquals(1, nbFileInPhase(sandbox, TraitementPhase.NORMAGE, TraitementEtat.OK));

ApiServiceFactory.getService(TraitementPhase.CONTROLE, sandbox, repertoire, 10000000, null).invokeApi();
ApiServiceFactory.getService(TraitementPhase.CONTROLE, sandbox, repertoire, 10000000, batchMode).invokeApi();
assertEquals(1, nbFileInPhase(sandbox, TraitementPhase.CONTROLE, TraitementEtat.OK));

ApiServiceFactory.getService(TraitementPhase.MAPPING, sandbox, repertoire, 10000000, null).invokeApi();
ApiServiceFactory.getService(TraitementPhase.MAPPING, sandbox, repertoire, 10000000, batchMode).invokeApi();
assertEquals(1, nbFileInPhase(sandbox, TraitementPhase.MAPPING, TraitementEtat.OK));

// test on data
Expand Down

0 comments on commit 8c7509c

Please sign in to comment.