4141import org .springframework .integration .dsl .IntegrationFlows ;
4242import org .springframework .integration .dsl .channel .MessageChannels ;
4343import org .springframework .integration .dsl .Pollers ;
44+ import org .springframework .integration .dsl .StandardIntegrationFlow ;
4445import org .springframework .integration .file .remote .aop .RotatingServerAdvice ;
4546import org .springframework .integration .file .remote .aop .RotatingServerAdvice .KeyDirectory ;
4647import org .springframework .integration .file .remote .session .CachingSessionFactory ;
@@ -97,6 +98,7 @@ public void testStandard() throws Exception {
9798 AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext (StandardConfig .class );
9899 StandardConfig config = ctx .getBean (StandardConfig .class );
99100 assertThat (config .latch .await (10 , TimeUnit .SECONDS )).isTrue ();
101+ ctx .getBean (StandardIntegrationFlow .class ).stop ();
100102 List <Integer > sfCalls = config .sessionSources .stream ().limit (17 ).collect (Collectors .toList ());
101103 assertThat (sfCalls ).containsExactly (1 , 1 , 1 , 2 , 2 , 2 , 3 , 3 , 3 , 1 , 1 , 2 , 2 , 3 , 3 , 1 , 1 );
102104 File f1 = new File (tmpDir + File .separator + "standard" + File .separator + "f1" );
@@ -114,6 +116,7 @@ public void testFair() throws Exception {
114116 AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext (FairConfig .class );
115117 StandardConfig config = ctx .getBean (StandardConfig .class );
116118 assertThat (config .latch .await (10 , TimeUnit .SECONDS )).isTrue ();
119+ ctx .getBean (StandardIntegrationFlow .class ).stop ();
117120 List <Integer > sfCalls = config .sessionSources .stream ().limit (17 ).collect (Collectors .toList ());
118121 assertThat (sfCalls ).containsExactly (1 , 1 , 2 , 2 , 3 , 3 , 1 , 1 , 2 , 2 , 3 , 3 , 1 , 1 , 2 , 2 , 3 );
119122 File f1 = new File (tmpDir + File .separator + "fair" + File .separator + "f1" );
@@ -132,6 +135,7 @@ public void testVariableLocalDir() throws Exception {
132135 AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext (VariableLocalConfig .class );
133136 StandardConfig config = ctx .getBean (StandardConfig .class );
134137 assertThat (config .latch .await (10 , TimeUnit .SECONDS )).isTrue ();
138+ ctx .getBean (StandardIntegrationFlow .class ).stop ();
135139 List <Integer > sfCalls = config .sessionSources .stream ().limit (17 ).collect (Collectors .toList ());
136140 assertThat (sfCalls ).containsExactly (1 , 1 , 1 , 2 , 2 , 2 , 3 , 3 , 3 , 1 , 1 , 2 , 2 , 3 , 3 , 1 , 1 );
137141 File f1 = new File (tmpDir + File .separator + "variable" + File .separator + "foo" + File .separator + "f1" );
@@ -148,6 +152,7 @@ public void testVariableLocalDir() throws Exception {
148152 public void testStreaming () throws Exception {
149153 AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext (StreamingConfig .class );
150154 StandardConfig config = ctx .getBean (StandardConfig .class );
155+ ctx .getBean (StandardIntegrationFlow .class ).stop ();
151156 assertThat (config .latch .await (10 , TimeUnit .SECONDS )).isTrue ();
152157 List <Integer > sfCalls = config .sessionSources .stream ().limit (17 ).collect (Collectors .toList ());
153158 // there's an extra getSession() with this adapter in listFiles
0 commit comments