File tree Expand file tree Collapse file tree 2 files changed +24
-23
lines changed
src/test/java/org/springframework/data/redis/connection/lettuce Expand file tree Collapse file tree 2 files changed +24
-23
lines changed Original file line number Diff line number Diff line change 20
20
import static org .hamcrest .core .IsNull .*;
21
21
import static org .junit .Assert .*;
22
22
23
- import io .lettuce .core .ReadFrom ;
24
23
import io .lettuce .core .RedisException ;
25
24
import io .lettuce .core .api .async .RedisAsyncCommands ;
26
25
import io .lettuce .core .api .reactive .BaseRedisReactiveCommands ;
@@ -363,28 +362,6 @@ public void factoryCreatesPooledConnections() {
363
362
factory .destroy ();
364
363
}
365
364
366
- @ Test // DATAREDIS-580
367
- public void factoryUsesMasterSlaveConnections () {
368
-
369
- LettuceClientConfiguration configuration = LettuceTestClientConfiguration .builder ().readFrom (ReadFrom .SLAVE )
370
- .build ();
371
-
372
- LettuceConnectionFactory factory = new LettuceConnectionFactory (SettingsUtils .standaloneConfiguration (),
373
- configuration );
374
- factory .afterPropertiesSet ();
375
-
376
- RedisConnection connection = factory .getConnection ();
377
-
378
- try {
379
- assertThat (connection .ping (), is (equalTo ("PONG" )));
380
- assertThat (connection .info ().getProperty ("role" ), is (equalTo ("slave" )));
381
- } finally {
382
- this .connection .close ();
383
- }
384
-
385
- factory .destroy ();
386
- }
387
-
388
365
@ Test // DATAREDIS-576
389
366
public void connectionAppliesClientName () {
390
367
Original file line number Diff line number Diff line change 35
35
import org .junit .runners .Parameterized ;
36
36
import org .junit .runners .Parameterized .Parameters ;
37
37
import org .springframework .data .redis .ConnectionFactoryTracker ;
38
+ import org .springframework .data .redis .SettingsUtils ;
38
39
import org .springframework .data .redis .connection .AbstractConnectionIntegrationTests ;
39
40
import org .springframework .data .redis .connection .DefaultStringRedisConnection ;
41
+ import org .springframework .data .redis .connection .RedisConnection ;
40
42
import org .springframework .data .redis .connection .RedisSentinelConfiguration ;
41
43
import org .springframework .data .redis .connection .RedisSentinelConnection ;
42
44
import org .springframework .data .redis .connection .RedisServer ;
@@ -210,4 +212,26 @@ public void factoryWithReadFromSlaveSettings() {
210
212
connection .close ();
211
213
}
212
214
}
215
+
216
+ @ Test // DATAREDIS-580
217
+ public void factoryUsesMasterSlaveConnections () {
218
+
219
+ LettuceClientConfiguration configuration = LettuceTestClientConfiguration .builder ().readFrom (ReadFrom .SLAVE )
220
+ .build ();
221
+
222
+ LettuceConnectionFactory factory = new LettuceConnectionFactory (SettingsUtils .standaloneConfiguration (),
223
+ configuration );
224
+ factory .afterPropertiesSet ();
225
+
226
+ RedisConnection connection = factory .getConnection ();
227
+
228
+ try {
229
+ assertThat (connection .ping (), is (equalTo ("PONG" )));
230
+ assertThat (connection .info ().getProperty ("role" ), is (equalTo ("slave" )));
231
+ } finally {
232
+ this .connection .close ();
233
+ }
234
+
235
+ factory .destroy ();
236
+ }
213
237
}
You can’t perform that action at this time.
0 commit comments