Skip to content

Commit 69efbd3

Browse files
committed
More Redis fixes for latest Spring Data
1 parent 50cf3b1 commit 69efbd3

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

spring-integration-redis/src/test/java/org/springframework/integration/redis/config/RedisQueueInboundChannelAdapterParserTests.java

+13-17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2019 the original author or authors.
2+
* Copyright 2013-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,22 +18,21 @@
1818

1919
import static org.assertj.core.api.Assertions.assertThat;
2020

21-
import org.junit.Test;
22-
import org.junit.runner.RunWith;
21+
import org.junit.jupiter.api.Test;
2322

2423
import org.springframework.beans.factory.annotation.Autowired;
2524
import org.springframework.beans.factory.annotation.Qualifier;
2625
import org.springframework.core.task.TaskExecutor;
2726
import org.springframework.data.redis.connection.RedisConnectionFactory;
27+
import org.springframework.data.redis.core.BoundListOperations;
2828
import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer;
2929
import org.springframework.data.redis.serializer.RedisSerializer;
3030
import org.springframework.integration.redis.inbound.RedisQueueMessageDrivenEndpoint;
3131
import org.springframework.integration.test.util.TestUtils;
3232
import org.springframework.integration.util.ErrorHandlingTaskExecutor;
3333
import org.springframework.messaging.MessageChannel;
3434
import org.springframework.test.annotation.DirtiesContext;
35-
import org.springframework.test.context.ContextConfiguration;
36-
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
35+
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
3736

3837

3938
/**
@@ -44,8 +43,7 @@
4443
*
4544
* @since 3.0
4645
*/
47-
@ContextConfiguration
48-
@RunWith(SpringJUnit4ClassRunner.class)
46+
@SpringJUnitConfig
4947
@DirtiesContext
5048
public class RedisQueueInboundChannelAdapterParserTests {
5149

@@ -91,12 +89,11 @@ public class RedisQueueInboundChannelAdapterParserTests {
9189

9290

9391
@Test
92+
@SuppressWarnings("unchecked")
9493
public void testInt3017DefaultConfig() {
95-
assertThat(TestUtils
96-
.getPropertyValue(this.defaultAdapter, "boundListOperations.ops.template.connectionFactory"))
97-
.isSameAs(this.connectionFactory);
98-
assertThat(TestUtils.getPropertyValue(this.defaultAdapter, "boundListOperations.key"))
99-
.isEqualTo("si.test.Int3017.Inbound1");
94+
BoundListOperations<String, byte[]> boundListOperations =
95+
TestUtils.getPropertyValue(this.defaultAdapter, "boundListOperations", BoundListOperations.class);
96+
assertThat(boundListOperations.getKey()).isEqualTo("si.test.Int3017.Inbound1");
10097
assertThat(TestUtils.getPropertyValue(this.defaultAdapter, "expectMessage", Boolean.class)).isFalse();
10198
assertThat(TestUtils.getPropertyValue(this.defaultAdapter, "receiveTimeout")).isEqualTo(1000L);
10299
assertThat(TestUtils.getPropertyValue(this.defaultAdapter, "recoveryInterval")).isEqualTo(5000L);
@@ -114,12 +111,11 @@ public void testInt3017DefaultConfig() {
114111

115112

116113
@Test
114+
@SuppressWarnings("unchecked")
117115
public void testInt3017CustomConfig() {
118-
assertThat(TestUtils.getPropertyValue(this.customAdapter, "boundListOperations.ops.template" +
119-
".connectionFactory"))
120-
.isSameAs(this.customRedisConnectionFactory);
121-
assertThat(TestUtils.getPropertyValue(this.customAdapter, "boundListOperations.key"))
122-
.isEqualTo("si.test.Int3017.Inbound2");
116+
BoundListOperations<String, byte[]> boundListOperations =
117+
TestUtils.getPropertyValue(this.customAdapter, "boundListOperations", BoundListOperations.class);
118+
assertThat(boundListOperations.getKey()).isEqualTo("si.test.Int3017.Inbound2");
123119
assertThat(TestUtils.getPropertyValue(this.customAdapter, "expectMessage", Boolean.class)).isTrue();
124120
assertThat(TestUtils.getPropertyValue(this.customAdapter, "receiveTimeout")).isEqualTo(2000L);
125121
assertThat(TestUtils.getPropertyValue(this.customAdapter, "recoveryInterval")).isEqualTo(3000L);

0 commit comments

Comments
 (0)