Test fixes
Class rule for Redis Do not pass message collector for test input bindings
This commit is contained in:
@@ -20,7 +20,7 @@ import static org.junit.Assert.assertTrue;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@@ -53,8 +53,8 @@ import org.springframework.util.Assert;
|
||||
@SpringApplicationConfiguration({ErrorChannelTests.TestSource.class, ErrorChannelTests.TestErrorSink.class})
|
||||
public class ErrorChannelTests {
|
||||
|
||||
@Rule
|
||||
public RedisTestSupport redisTestSupport = new RedisTestSupport();
|
||||
@ClassRule
|
||||
public static RedisTestSupport redisTestSupport = new RedisTestSupport();
|
||||
|
||||
@Autowired
|
||||
@Bindings(TestErrorSink.class)
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.util.Map;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.ClassRule;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@@ -54,8 +54,8 @@ import org.springframework.tuple.Tuple;
|
||||
MessageChannelConfigurerTests.TestSink.class})
|
||||
public class MessageChannelConfigurerTests {
|
||||
|
||||
@Rule
|
||||
public RedisTestSupport redisTestSupport = new RedisTestSupport();
|
||||
@ClassRule
|
||||
public static RedisTestSupport redisTestSupport = new RedisTestSupport();
|
||||
|
||||
@Autowired @Bindings(TestSink.class)
|
||||
private Sink testSink;
|
||||
|
||||
@@ -53,7 +53,7 @@ public class TestSupportBinder implements Binder<MessageChannel> {
|
||||
|
||||
@Override
|
||||
public Binding<MessageChannel> bindConsumer(String name, String group, MessageChannel inboundBindTarget, Properties properties) {
|
||||
return new TestBinding(inboundBindTarget, messageCollector);
|
||||
return new TestBinding(inboundBindTarget, null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,7 +124,9 @@ public class TestSupportBinder implements Binder<MessageChannel> {
|
||||
|
||||
@Override
|
||||
public void unbind() {
|
||||
messageCollector.unregister(target);
|
||||
if (messageCollector != null) {
|
||||
messageCollector.unregister(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user