INT-3470: Fix SF 4.1 Compatibility

JIRA: https://jira.spring.io/browse/INT-3470

According to the commit https://github.com/spring-projects/spring-framework/commit/c06ac06,
the `MessagingException` is now `NestedRuntimeException` including nested StackTrace.
Hence test-cases have to be changed to the `Mathers.containsString` instead of `equals` for the `e.getMessage()`

**Cherry-pick to the 4.0.x**
This commit is contained in:
Artem Bilan
2014-08-11 11:19:02 +03:00
committed by Gary Russell
parent 938d61f1b0
commit edbbcef5b3
9 changed files with 80 additions and 36 deletions

View File

@@ -15,8 +15,9 @@
*/
package org.springframework.integration.redis.channel;
import static org.junit.Assert.assertEquals;
import static org.hamcrest.Matchers.containsString;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.mock;
@@ -104,8 +105,8 @@ public class SubscribableRedisChannelTests extends RedisAvailableTests {
catch (InvocationTargetException e) {
Throwable cause = e.getCause();
assertNotNull(cause);
assertEquals("Dispatcher has no subscribers for redis-channel 'si.test.channel.no.subs' (dhnsChannel).",
cause.getMessage());
assertThat(cause.getMessage(),
containsString("Dispatcher has no subscribers for redis-channel 'si.test.channel.no.subs' (dhnsChannel)."));
}
}