41
41
import org .springframework .integration .dsl .IntegrationFlows ;
42
42
import org .springframework .integration .dsl .MessageChannels ;
43
43
import org .springframework .integration .dsl .Pollers ;
44
+ import org .springframework .integration .dsl .StandardIntegrationFlow ;
44
45
import org .springframework .integration .file .remote .aop .RotatingServerAdvice ;
45
46
import org .springframework .integration .file .remote .aop .RotatingServerAdvice .KeyDirectory ;
46
47
import org .springframework .integration .file .remote .session .CachingSessionFactory ;
@@ -96,6 +97,7 @@ public void testStandard() throws Exception {
96
97
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext (StandardConfig .class );
97
98
StandardConfig config = ctx .getBean (StandardConfig .class );
98
99
assertThat (config .latch .await (10 , TimeUnit .SECONDS )).isTrue ();
100
+ ctx .getBean (StandardIntegrationFlow .class ).stop ();
99
101
List <Integer > sfCalls = config .sessionSources .stream ().limit (17 ).collect (Collectors .toList ());
100
102
assertThat (sfCalls ).containsExactly (1 , 1 , 1 , 2 , 2 , 2 , 3 , 3 , 3 , 1 , 1 , 2 , 2 , 3 , 3 , 1 , 1 );
101
103
File f1 = new File (tmpDir + File .separator + "standard" + File .separator + "f1" );
@@ -113,6 +115,7 @@ public void testFair() throws Exception {
113
115
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext (FairConfig .class );
114
116
StandardConfig config = ctx .getBean (StandardConfig .class );
115
117
assertThat (config .latch .await (10 , TimeUnit .SECONDS )).isTrue ();
118
+ ctx .getBean (StandardIntegrationFlow .class ).stop ();
116
119
List <Integer > sfCalls = config .sessionSources .stream ().limit (17 ).collect (Collectors .toList ());
117
120
assertThat (sfCalls ).containsExactly (1 , 1 , 2 , 2 , 3 , 3 , 1 , 1 , 2 , 2 , 3 , 3 , 1 , 1 , 2 , 2 , 3 );
118
121
File f1 = new File (tmpDir + File .separator + "fair" + File .separator + "f1" );
@@ -130,6 +133,7 @@ public void testVariableLocalDir() throws Exception {
130
133
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext (VariableLocalConfig .class );
131
134
StandardConfig config = ctx .getBean (StandardConfig .class );
132
135
assertThat (config .latch .await (10 , TimeUnit .SECONDS )).isTrue ();
136
+ ctx .getBean (StandardIntegrationFlow .class ).stop ();
133
137
List <Integer > sfCalls = config .sessionSources .stream ().limit (17 ).collect (Collectors .toList ());
134
138
assertThat (sfCalls ).containsExactly (1 , 1 , 1 , 2 , 2 , 2 , 3 , 3 , 3 , 1 , 1 , 2 , 2 , 3 , 3 , 1 , 1 );
135
139
File f1 = new File (tmpDir + File .separator + "variable" + File .separator + "foo" + File .separator + "f1" );
@@ -146,6 +150,7 @@ public void testVariableLocalDir() throws Exception {
146
150
public void testStreaming () throws Exception {
147
151
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext (StreamingConfig .class );
148
152
StandardConfig config = ctx .getBean (StandardConfig .class );
153
+ ctx .getBean (StandardIntegrationFlow .class ).stop ();
149
154
assertThat (config .latch .await (10 , TimeUnit .SECONDS )).isTrue ();
150
155
List <Integer > sfCalls = config .sessionSources .stream ().limit (17 ).collect (Collectors .toList ());
151
156
// there's an extra getSession() with this adapter in listFiles
0 commit comments