File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
src/test/java/org/springframework/data/redis/connection/jedis Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -258,6 +258,25 @@ public void hScanShouldCloseTheConnectionWhenCursorIsClosed() throws IOException
258
258
verify (jedisSpy , times (1 )).quit ();
259
259
}
260
260
261
+ @ Test // DATAREDIS-714, DATAREDIS-790
262
+ public void doesNotSelectDbWhenCurrentDbMatchesDesiredOne () {
263
+
264
+ Jedis jedisSpy = spy (new MockedClientJedis ("http://localhost:1234" , getNativeRedisConnectionMock ()));
265
+ new JedisConnection (jedisSpy );
266
+
267
+ verify (jedisSpy , never ()).select (anyInt ());
268
+ }
269
+
270
+ @ Test // DATAREDIS-714, DATAREDIS-790
271
+ public void doesNotSelectDbWhenCurrentDbDoesNotMatchDesiredOne () {
272
+
273
+ Jedis jedisSpy = spy (new MockedClientJedis ("http://localhost:1234" , getNativeRedisConnectionMock ()));
274
+ when (jedisSpy .getDB ()).thenReturn (3L );
275
+
276
+ new JedisConnection (jedisSpy );
277
+
278
+ verify (jedisSpy ).select (eq (0 ));
279
+ }
261
280
}
262
281
263
282
public static class JedisConnectionPipelineUnitTests extends JedisConnectionUnitTests {
You can’t perform that action at this time.
0 commit comments