Skip to content

Commit 378258e

Browse files
committed
Fix Redis tests according to the latest Spring Data Redis
1 parent 9f86108 commit 378258e

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

spring-integration-redis/src/test/java/org/springframework/integration/redis/outbound/RedisQueueOutboundChannelAdapterTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import org.springframework.data.redis.connection.RedisConnectionFactory;
2828
import org.springframework.data.redis.core.RedisTemplate;
2929
import org.springframework.data.redis.core.StringRedisTemplate;
30-
import org.springframework.data.redis.serializer.Jackson3JsonRedisSerializer;
30+
import org.springframework.data.redis.serializer.GenericJacksonJsonRedisSerializer;
3131
import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer;
3232
import org.springframework.data.redis.serializer.StringRedisSerializer;
3333
import org.springframework.integration.mapping.InboundMessageMapper;
@@ -131,7 +131,8 @@ void testInt3015ExplicitSerializer() {
131131

132132
final RedisQueueOutboundChannelAdapter handler = new RedisQueueOutboundChannelAdapter(queueName,
133133
this.connectionFactory);
134-
handler.setSerializer(new Jackson3JsonRedisSerializer<Object>(Object.class));
134+
handler.setSerializer(GenericJacksonJsonRedisSerializer.create(b -> {
135+
}));
135136

136137
RedisTemplate<String, ?> redisTemplate = new StringRedisTemplate();
137138
redisTemplate.setConnectionFactory(this.connectionFactory);

spring-integration-redis/src/test/java/org/springframework/integration/redis/store/RedisChannelMessageStoreTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import tools.jackson.databind.json.JsonMapper;
2727

2828
import org.springframework.beans.factory.annotation.Autowired;
29-
import org.springframework.data.redis.serializer.GenericJackson3JsonRedisSerializer;
29+
import org.springframework.data.redis.serializer.GenericJacksonJsonRedisSerializer;
3030
import org.springframework.integration.IntegrationMessageHeaderAccessor;
3131
import org.springframework.integration.channel.NullChannel;
3232
import org.springframework.integration.history.MessageHistory;
@@ -183,7 +183,7 @@ void testPriority() {
183183
void testJsonSerialization() {
184184
RedisChannelMessageStore store = new RedisChannelMessageStore(RedisContainerTest.connectionFactory());
185185
JsonMapper mapper = JacksonMessagingUtils.messagingAwareMapper();
186-
GenericJackson3JsonRedisSerializer serializer = new GenericJackson3JsonRedisSerializer(mapper);
186+
GenericJacksonJsonRedisSerializer serializer = new GenericJacksonJsonRedisSerializer(mapper);
187187
store.setValueSerializer(serializer);
188188

189189
Message<?> genericMessage = new GenericMessage<>(new Date());

spring-integration-redis/src/test/java/org/springframework/integration/redis/store/RedisMessageGroupStoreTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
import org.springframework.context.support.ClassPathXmlApplicationContext;
3939
import org.springframework.data.redis.connection.RedisConnectionFactory;
4040
import org.springframework.data.redis.core.StringRedisTemplate;
41-
import org.springframework.data.redis.serializer.GenericJackson3JsonRedisSerializer;
41+
import org.springframework.data.redis.serializer.GenericJacksonJsonRedisSerializer;
4242
import org.springframework.data.redis.serializer.SerializationException;
4343
import org.springframework.integration.channel.DirectChannel;
4444
import org.springframework.integration.channel.NullChannel;
@@ -393,7 +393,7 @@ void testAddAndRemoveMessagesFromMessageGroup() {
393393
void testJsonSerialization() {
394394
JsonMapper mapper = JacksonMessagingUtils.messagingAwareMapper();
395395

396-
GenericJackson3JsonRedisSerializer serializer = new GenericJackson3JsonRedisSerializer(mapper);
396+
GenericJacksonJsonRedisSerializer serializer = new GenericJacksonJsonRedisSerializer(mapper);
397397
store.setValueSerializer(serializer);
398398

399399
Message<?> genericMessage = new GenericMessage<>(new Date());
@@ -444,7 +444,7 @@ void testJsonSerialization() {
444444

445445
mapper = JacksonMessagingUtils.messagingAwareMapper(getClass().getPackage().getName());
446446

447-
serializer = new GenericJackson3JsonRedisSerializer(mapper);
447+
serializer = new GenericJacksonJsonRedisSerializer(mapper);
448448
store.setValueSerializer(serializer);
449449

450450
store.removeMessageGroup(this.groupId);
@@ -454,7 +454,7 @@ void testJsonSerialization() {
454454

455455
mapper = JacksonMessagingUtils.messagingAwareMapper("*");
456456

457-
serializer = new GenericJackson3JsonRedisSerializer(mapper);
457+
serializer = new GenericJacksonJsonRedisSerializer(mapper);
458458
store.setValueSerializer(serializer);
459459

460460
store.removeMessageGroup(this.groupId);

0 commit comments

Comments
 (0)