Some fixes and improvements
https://build.spring.io/browse/INT-MJATS41-629 * Revert to SF and SA BUILD-SNAPSHOTs * Upgrade to Spring Security 4.1 * Fix `RedisQueueMessageDrivenEndpointTests.testInt3442ProperlyStop()` for `atLeastOnce()` verification because in between stop and the last `rightPush` there might be one more `pop` and push again because of `listening = false` state * There is still sporadic `OutboundGatewayFunctionTests.testLazyContainerWithDest()`, so revise all the JMS tests for: - proper `ApplicationContext.stop()` in the end of test - `@DirtiesContext` if `SpringJUnit4ClassRunner` is in use - `TaskScheduler.destroy()` if that The JMS fix might relate to the https://jira.spring.io/browse/INT-4030, therefore consider this fix for cherry-picking into `4.2.x` (excluding `build.gradle` changes)
This commit is contained in:
@@ -21,6 +21,7 @@ import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.mockito.internal.verification.VerificationModeFactory.atLeastOnce;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -116,7 +117,8 @@ public class RedisQueueMessageDrivenEndpointTests extends RedisAvailableTests {
|
||||
|
||||
PollableChannel channel = new QueueChannel();
|
||||
|
||||
RedisQueueMessageDrivenEndpoint endpoint = new RedisQueueMessageDrivenEndpoint(queueName, this.connectionFactory);
|
||||
RedisQueueMessageDrivenEndpoint endpoint =
|
||||
new RedisQueueMessageDrivenEndpoint(queueName, this.connectionFactory);
|
||||
endpoint.setBeanFactory(Mockito.mock(BeanFactory.class));
|
||||
endpoint.setOutputChannel(channel);
|
||||
endpoint.setReceiveTimeout(1000);
|
||||
@@ -274,15 +276,14 @@ public class RedisQueueMessageDrivenEndpointTests extends RedisAvailableTests {
|
||||
|
||||
assertTrue(stopLatch.await(10, TimeUnit.SECONDS));
|
||||
|
||||
Mockito.verify(boundListOperations).rightPush(Mockito.any(byte[].class));
|
||||
Mockito.verify(boundListOperations, atLeastOnce()).rightPush(Mockito.any(byte[].class));
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
@RedisAvailable
|
||||
@SuppressWarnings("unchecked")
|
||||
@Ignore
|
||||
//JedisConnectionFactory doesn't support proper 'destroy()' and allows to create new fresh Redis connection
|
||||
@Ignore("JedisConnectionFactory doesn't support proper 'destroy()' and allows to create new fresh Redis connection")
|
||||
public void testInt3196Recovery() throws Exception {
|
||||
String queueName = "test.si.Int3196Recovery";
|
||||
QueueChannel channel = new QueueChannel();
|
||||
@@ -398,7 +399,8 @@ public class RedisQueueMessageDrivenEndpointTests extends RedisAvailableTests {
|
||||
break;
|
||||
}
|
||||
Thread.sleep(100);
|
||||
} while (!endpoint.isListening());
|
||||
}
|
||||
while (!endpoint.isListening());
|
||||
|
||||
assertTrue(n < 100);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user