1
1
/*
2
- * Copyright 2013-2019 the original author or authors.
2
+ * Copyright 2013-2022 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
18
18
19
19
import static org .assertj .core .api .Assertions .assertThat ;
20
20
21
- import org .junit .Test ;
22
- import org .junit .runner .RunWith ;
21
+ import org .junit .jupiter .api .Test ;
23
22
24
23
import org .springframework .beans .factory .annotation .Autowired ;
25
24
import org .springframework .beans .factory .annotation .Qualifier ;
26
25
import org .springframework .core .task .TaskExecutor ;
27
26
import org .springframework .data .redis .connection .RedisConnectionFactory ;
27
+ import org .springframework .data .redis .core .BoundListOperations ;
28
28
import org .springframework .data .redis .serializer .JdkSerializationRedisSerializer ;
29
29
import org .springframework .data .redis .serializer .RedisSerializer ;
30
30
import org .springframework .integration .redis .inbound .RedisQueueMessageDrivenEndpoint ;
31
31
import org .springframework .integration .test .util .TestUtils ;
32
32
import org .springframework .integration .util .ErrorHandlingTaskExecutor ;
33
33
import org .springframework .messaging .MessageChannel ;
34
34
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 ;
37
36
38
37
39
38
/**
44
43
*
45
44
* @since 3.0
46
45
*/
47
- @ ContextConfiguration
48
- @ RunWith (SpringJUnit4ClassRunner .class )
46
+ @ SpringJUnitConfig
49
47
@ DirtiesContext
50
48
public class RedisQueueInboundChannelAdapterParserTests {
51
49
@@ -91,12 +89,11 @@ public class RedisQueueInboundChannelAdapterParserTests {
91
89
92
90
93
91
@ Test
92
+ @ SuppressWarnings ("unchecked" )
94
93
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" );
100
97
assertThat (TestUtils .getPropertyValue (this .defaultAdapter , "expectMessage" , Boolean .class )).isFalse ();
101
98
assertThat (TestUtils .getPropertyValue (this .defaultAdapter , "receiveTimeout" )).isEqualTo (1000L );
102
99
assertThat (TestUtils .getPropertyValue (this .defaultAdapter , "recoveryInterval" )).isEqualTo (5000L );
@@ -114,12 +111,11 @@ public void testInt3017DefaultConfig() {
114
111
115
112
116
113
@ Test
114
+ @ SuppressWarnings ("unchecked" )
117
115
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" );
123
119
assertThat (TestUtils .getPropertyValue (this .customAdapter , "expectMessage" , Boolean .class )).isTrue ();
124
120
assertThat (TestUtils .getPropertyValue (this .customAdapter , "receiveTimeout" )).isEqualTo (2000L );
125
121
assertThat (TestUtils .getPropertyValue (this .customAdapter , "recoveryInterval" )).isEqualTo (3000L );
0 commit comments