From 4bb4a0187a8b92c32a38e3a75c5d7272c60d7807 Mon Sep 17 00:00:00 2001 From: Kiel Boatman Date: Sun, 18 Feb 2018 17:25:58 +0000 Subject: [PATCH] GH-2364 fix intermittent failing test Resolves https://github.com/spring-projects/spring-integration/issues/2364 --- .../integration/endpoint/PollingConsumerEndpointTests.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PollingConsumerEndpointTests.java b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PollingConsumerEndpointTests.java index 4c1bde8314..f7b569dff3 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PollingConsumerEndpointTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/endpoint/PollingConsumerEndpointTests.java @@ -45,6 +45,7 @@ import org.springframework.util.ErrorHandler; /** * @author Iwein Fuld * @author Mark Fisher + * @author Kiel Boatman */ @SuppressWarnings("unchecked") public class PollingConsumerEndpointTests { @@ -63,13 +64,14 @@ public class PollingConsumerEndpointTests { private final TestErrorHandler errorHandler = new TestErrorHandler(); - private final PollableChannel channelMock = Mockito.mock(PollableChannel.class); + private PollableChannel channelMock; private final ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler(); @Before public void init() throws Exception { + channelMock = Mockito.mock(PollableChannel.class); consumer.counter.set(0); trigger.reset(); endpoint = new PollingConsumer(channelMock, consumer); @@ -81,7 +83,6 @@ public class PollingConsumerEndpointTests { endpoint.setReceiveTimeout(-1); endpoint.afterPropertiesSet(); taskScheduler.afterPropertiesSet(); - Mockito.reset(channelMock); } @After