1515 */
1616package com .marklogic .hub .flow ;
1717
18+ import com .marklogic .bootstrap .Installer ;
1819import com .marklogic .client .io .DOMHandle ;
1920import com .marklogic .client .io .DocumentMetadataHandle ;
2021import com .marklogic .hub .FlowManager ;
2627import com .marklogic .hub .scaffold .Scaffolding ;
2728import org .apache .commons .io .FileUtils ;
2829import org .json .JSONException ;
30+ import org .junit .jupiter .api .BeforeAll ;
2931import org .junit .jupiter .api .BeforeEach ;
3032import org .junit .jupiter .api .Test ;
3133import org .junit .jupiter .api .extension .ExtendWith ;
@@ -56,6 +58,11 @@ public class FlowManagerTest extends HubTestBase {
5658
5759 @ Autowired
5860 private Scaffolding scaffolding ;
61+
62+ @ BeforeAll
63+ public static void runOnce () {
64+ new Installer ().deleteProjectDir ();
65+ }
5966
6067 @ BeforeEach
6168 public void setup () throws IOException {
@@ -309,6 +316,7 @@ public void testRunFlowWithBackwards() throws SAXException, IOException, ParserC
309316 installModules ();
310317 assertEquals (0 , getStagingDocCount ());
311318 assertEquals (2 , getFinalDocCount ());
319+ getHubFlowRunnerConfig ();
312320 Flow flow1 = fm .getFlow ("test" , "my-test-flow1" );
313321 FlowRunner flowRunner = fm .newFlowRunner ()
314322 .withFlow (flow1 )
@@ -318,6 +326,7 @@ public void testRunFlowWithBackwards() throws SAXException, IOException, ParserC
318326 .withDestinationDatabase (HubConfig .DEFAULT_STAGING_NAME );
319327 flowRunner .run ();
320328 flowRunner .awaitCompletion ();
329+ getHubAdminConfig ();
321330 assertEquals (2 , getStagingDocCount ());
322331 assertEquals (2 , getFinalDocCount ());
323332 assertXMLEqual (getXmlFromResource ("flow-manager-test/harmonized/harmonized1.xml" ), stagingDocMgr .read ("/employee1.xml" ).next ().getContent (new DOMHandle ()).get () );
@@ -343,13 +352,15 @@ public void testRunFlowWithHeader() throws SAXException, IOException, ParserConf
343352
344353 assertEquals (2 , getStagingDocCount ());
345354 assertEquals (0 , getFinalDocCount ());
355+ getHubFlowRunnerConfig ();
346356 Flow flow1 = fm .getFlow ("test" , "my-test-flow-with-header" );
347357 FlowRunner flowRunner = fm .newFlowRunner ()
348358 .withFlow (flow1 )
349359 .withBatchSize (10 )
350360 .withThreadCount (1 );
351361 flowRunner .run ();
352362 flowRunner .awaitCompletion ();
363+ getHubAdminConfig ();
353364 assertEquals (2 , getStagingDocCount ());
354365 assertEquals (2 , getFinalDocCount ());
355366 assertXMLEqual (getXmlFromResource ("flow-manager-test/harmonized-with-header/harmonized1.xml" ), finalDocMgr .read ("/employee1.xml" ).next ().getContent (new DOMHandle ()).get () );
@@ -373,13 +384,15 @@ public void testRunFlowWithAll() throws SAXException, IOException, ParserConfigu
373384
374385 assertEquals (2 , getStagingDocCount ());
375386 assertEquals (0 , getFinalDocCount ());
387+ getHubFlowRunnerConfig ();
376388 Flow flow1 = fm .getFlow ("test" , "my-test-flow-with-all" );
377389 FlowRunner flowRunner = fm .newFlowRunner ()
378390 .withFlow (flow1 )
379391 .withBatchSize (10 )
380392 .withThreadCount (1 );
381393 flowRunner .run ();
382394 flowRunner .awaitCompletion ();
395+ getHubAdminConfig ();
383396 assertEquals (2 , getStagingDocCount ());
384397 assertEquals (2 , getFinalDocCount ());
385398 assertXMLEqual (getXmlFromResource ("flow-manager-test/harmonized-with-all/harmonized1.xml" ), finalDocMgr .read ("/employee1.xml" ).next ().getContent (new DOMHandle ()).get () );
0 commit comments