Test fixes

Class rule for Redis
Do not pass message collector for test input bindings
This commit is contained in:
Marius Bogoevici
2016-03-02 11:27:25 -05:00
parent e77bcc3e4c
commit 5670e29776
3 changed files with 10 additions and 8 deletions

View File

@@ -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)

View File

@@ -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;

View File

@@ -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);
}
}
}
}