Skip to content

Commit 4bb4a01

Browse files
boaty82garyrussell
authored andcommitted
GH-2364 fix intermittent failing test
Resolves #2364
1 parent 4397807 commit 4bb4a01

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spring-integration-core/src/test/java/org/springframework/integration/endpoint/PollingConsumerEndpointTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
/**
4646
* @author Iwein Fuld
4747
* @author Mark Fisher
48+
* @author Kiel Boatman
4849
*/
4950
@SuppressWarnings("unchecked")
5051
public class PollingConsumerEndpointTests {
@@ -63,13 +64,14 @@ public class PollingConsumerEndpointTests {
6364

6465
private final TestErrorHandler errorHandler = new TestErrorHandler();
6566

66-
private final PollableChannel channelMock = Mockito.mock(PollableChannel.class);
67+
private PollableChannel channelMock;
6768

6869
private final ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
6970

7071

7172
@Before
7273
public void init() throws Exception {
74+
channelMock = Mockito.mock(PollableChannel.class);
7375
consumer.counter.set(0);
7476
trigger.reset();
7577
endpoint = new PollingConsumer(channelMock, consumer);
@@ -81,7 +83,6 @@ public void init() throws Exception {
8183
endpoint.setReceiveTimeout(-1);
8284
endpoint.afterPropertiesSet();
8385
taskScheduler.afterPropertiesSet();
84-
Mockito.reset(channelMock);
8586
}
8687

8788
@After

0 commit comments

Comments
 (0)