Refined the test case

This commit is contained in:
sameira 2016-02-18 22:51:35 +05:30
parent a304aa9860
commit 2ccdd4ecbb
3 changed files with 4 additions and 5 deletions

View File

@ -3,5 +3,5 @@ package org.baeldung.spring.data.redis.queue;
public interface MessagePublisher { public interface MessagePublisher {
void publish(String message); void publish(final String message);
} }

View File

@ -16,13 +16,13 @@ public class RedisMessagePublisher implements MessagePublisher {
public RedisMessagePublisher() { public RedisMessagePublisher() {
} }
public RedisMessagePublisher(RedisTemplate<String, Object> redisTemplate, public RedisMessagePublisher(final RedisTemplate<String, Object> redisTemplate,
ChannelTopic topic) { final ChannelTopic topic) {
this.redisTemplate = redisTemplate; this.redisTemplate = redisTemplate;
this.topic = topic; this.topic = topic;
} }
public void publish(String message) { public void publish(final String message) {
redisTemplate.convertAndSend(topic.getTopic(), message); redisTemplate.convertAndSend(topic.getTopic(), message);
} }
} }

View File

@ -17,7 +17,6 @@ import static org.junit.Assert.assertTrue;
@ContextConfiguration(classes = RedisConfig.class) @ContextConfiguration(classes = RedisConfig.class)
public class RedisMessageListenerTest { public class RedisMessageListenerTest {
@Autowired @Autowired
private RedisMessagePublisher redisMessagePublisher; private RedisMessagePublisher redisMessagePublisher;