41
41
import org .springframework .integration .dsl .IntegrationFlows ;
42
42
import org .springframework .integration .dsl .channel .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 ;
@@ -97,6 +98,7 @@ public void testStandard() throws Exception {
97
98
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext (StandardConfig .class );
98
99
StandardConfig config = ctx .getBean (StandardConfig .class );
99
100
assertThat (config .latch .await (10 , TimeUnit .SECONDS )).isTrue ();
101
+ ctx .getBean (StandardIntegrationFlow .class ).stop ();
100
102
List <Integer > sfCalls = config .sessionSources .stream ().limit (17 ).collect (Collectors .toList ());
101
103
assertThat (sfCalls ).containsExactly (1 , 1 , 1 , 2 , 2 , 2 , 3 , 3 , 3 , 1 , 1 , 2 , 2 , 3 , 3 , 1 , 1 );
102
104
File f1 = new File (tmpDir + File .separator + "standard" + File .separator + "f1" );
@@ -114,6 +116,7 @@ public void testFair() throws Exception {
114
116
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext (FairConfig .class );
115
117
StandardConfig config = ctx .getBean (StandardConfig .class );
116
118
assertThat (config .latch .await (10 , TimeUnit .SECONDS )).isTrue ();
119
+ ctx .getBean (StandardIntegrationFlow .class ).stop ();
117
120
List <Integer > sfCalls = config .sessionSources .stream ().limit (17 ).collect (Collectors .toList ());
118
121
assertThat (sfCalls ).containsExactly (1 , 1 , 2 , 2 , 3 , 3 , 1 , 1 , 2 , 2 , 3 , 3 , 1 , 1 , 2 , 2 , 3 );
119
122
File f1 = new File (tmpDir + File .separator + "fair" + File .separator + "f1" );
@@ -132,6 +135,7 @@ public void testVariableLocalDir() throws Exception {
132
135
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext (VariableLocalConfig .class );
133
136
StandardConfig config = ctx .getBean (StandardConfig .class );
134
137
assertThat (config .latch .await (10 , TimeUnit .SECONDS )).isTrue ();
138
+ ctx .getBean (StandardIntegrationFlow .class ).stop ();
135
139
List <Integer > sfCalls = config .sessionSources .stream ().limit (17 ).collect (Collectors .toList ());
136
140
assertThat (sfCalls ).containsExactly (1 , 1 , 1 , 2 , 2 , 2 , 3 , 3 , 3 , 1 , 1 , 2 , 2 , 3 , 3 , 1 , 1 );
137
141
File f1 = new File (tmpDir + File .separator + "variable" + File .separator + "foo" + File .separator + "f1" );
@@ -148,6 +152,7 @@ public void testVariableLocalDir() throws Exception {
148
152
public void testStreaming () throws Exception {
149
153
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext (StreamingConfig .class );
150
154
StandardConfig config = ctx .getBean (StandardConfig .class );
155
+ ctx .getBean (StandardIntegrationFlow .class ).stop ();
151
156
assertThat (config .latch .await (10 , TimeUnit .SECONDS )).isTrue ();
152
157
List <Integer > sfCalls = config .sessionSources .stream ().limit (17 ).collect (Collectors .toList ());
153
158
// there's an extra getSession() with this adapter in listFiles
0 commit comments