2222import redis .clients .jedis .exceptions .JedisException ;
2323
2424@ Tag ("integration" )
25- public class JedisPooledTest {
25+ public class RedisClientTest {
2626
2727 private static final EndpointConfig endpointStandalone7 = HostAndPorts .getRedisEndpoint (
2828 "standalone7-with-lfu-policy" );
@@ -31,7 +31,7 @@ public class JedisPooledTest {
3131
3232 @ Test
3333 public void checkCloseableConnections () {
34- JedisPooled pool = JedisPooled .builder ()
34+ RedisClient pool = RedisClient .builder ()
3535 .hostAndPort (endpointStandalone7 .getHost (), endpointStandalone7 .getPort ())
3636 .clientConfig (DefaultJedisClientConfig .builder ().timeoutMillis (2000 ).build ()).build ();
3737 pool .set ("foo" , "bar" );
@@ -42,7 +42,7 @@ public void checkCloseableConnections() {
4242
4343 @ Test
4444 public void checkResourceWithConfig () {
45- try (JedisPooled pool = JedisPooled .builder ().hostAndPort (endpointStandalone7 .getHostAndPort ())
45+ try (RedisClient pool = RedisClient .builder ().hostAndPort (endpointStandalone7 .getHostAndPort ())
4646 .clientConfig (DefaultJedisClientConfig .builder ().socketTimeoutMillis (5000 ).build ())
4747 .build ()) {
4848
@@ -59,7 +59,7 @@ public void checkPoolOverflow() {
5959 config .setMaxTotal (1 );
6060 config .setBlockWhenExhausted (false );
6161 try (
62- JedisPooled pool = JedisPooled .builder ().hostAndPort (endpointStandalone7 .getHostAndPort ())
62+ RedisClient pool = RedisClient .builder ().hostAndPort (endpointStandalone7 .getHostAndPort ())
6363 .poolConfig (config ).build ();
6464 Connection jedis = pool .getPool ().getResource ()) {
6565 assertThrows (JedisException .class , () -> pool .getPool ().getResource ());
@@ -74,7 +74,7 @@ public void startWithUrlString() {
7474 j .set ("foo" , "bar" );
7575 }
7676
77- try (JedisPooled pool = JedisPooled .builder ()
77+ try (RedisClient pool = RedisClient .builder ()
7878 .fromURI (endpointStandalone1 .getURIBuilder ()
7979 .credentials ("" , endpointStandalone1 .getPassword ()).path ("/2" ).build ().toString ())
8080 .build ()) {
@@ -90,7 +90,7 @@ public void startWithUrl() throws URISyntaxException {
9090 j .set ("foo" , "bar" );
9191 }
9292
93- try (JedisPooled pool = JedisPooled .builder ().fromURI (endpointStandalone1 .getURIBuilder ()
93+ try (RedisClient pool = RedisClient .builder ().fromURI (endpointStandalone1 .getURIBuilder ()
9494 .credentials ("" , endpointStandalone1 .getPassword ()).path ("/2" ).build ()).build ()) {
9595 assertEquals ("bar" , pool .get ("foo" ));
9696 }
@@ -99,19 +99,19 @@ public void startWithUrl() throws URISyntaxException {
9999 @ Test
100100 public void shouldThrowExceptionForInvalidURI () {
101101 assertThrows (Exception .class ,
102- () -> JedisPooled .builder ().fromURI (new URI ("localhost:6380" )).build ());
102+ () -> RedisClient .builder ().fromURI (new URI ("localhost:6380" )).build ());
103103 }
104104
105105 @ Test
106106 public void allowUrlWithNoDBAndNoPassword () throws URISyntaxException {
107- JedisPooled .builder ().fromURI (endpointStandalone1 .getURI ().toString ()).build ().close ();
108- JedisPooled .builder ().fromURI (endpointStandalone1 .getURI ()).build ().close ();
107+ RedisClient .builder ().fromURI (endpointStandalone1 .getURI ().toString ()).build ().close ();
108+ RedisClient .builder ().fromURI (endpointStandalone1 .getURI ()).build ().close ();
109109 }
110110
111111 @ Test
112112 public void customClientName () {
113113 try (
114- JedisPooled pool = JedisPooled .builder ().hostAndPort (endpointStandalone7 .getHostAndPort ())
114+ RedisClient pool = RedisClient .builder ().hostAndPort (endpointStandalone7 .getHostAndPort ())
115115 .clientConfig (
116116 DefaultJedisClientConfig .builder ().clientName ("my_shiny_client_name" ).build ())
117117 .build ();
@@ -123,7 +123,7 @@ public void customClientName() {
123123 @ Test
124124 public void invalidClientName () {
125125 try (
126- JedisPooled pool = JedisPooled .builder ().hostAndPort (endpointStandalone7 .getHostAndPort ())
126+ RedisClient pool = RedisClient .builder ().hostAndPort (endpointStandalone7 .getHostAndPort ())
127127 .clientConfig (
128128 DefaultJedisClientConfig .builder ().clientName ("invalid client name" ).build ())
129129 .build ();
@@ -137,7 +137,7 @@ public void invalidClientName() {
137137
138138 @ Test
139139 public void getNumActiveWhenPoolIsClosed () {
140- JedisPooled pool = JedisPooled .builder ().hostAndPort (endpointStandalone7 .getHostAndPort ())
140+ RedisClient pool = RedisClient .builder ().hostAndPort (endpointStandalone7 .getHostAndPort ())
141141 .build ();
142142
143143 try (Connection j = pool .getPool ().getResource ()) {
@@ -150,7 +150,7 @@ public void getNumActiveWhenPoolIsClosed() {
150150
151151 @ Test
152152 public void getNumActiveReturnsTheCorrectNumber () {
153- try (JedisPooled pool = JedisPooled .builder ()
153+ try (RedisClient pool = RedisClient .builder ()
154154 .hostAndPort (endpointStandalone7 .getHost (), endpointStandalone7 .getPort ())
155155 .clientConfig (DefaultJedisClientConfig .builder ().timeoutMillis (2000 ).build ())
156156 .poolConfig (new ConnectionPoolConfig ()).build ()) {
@@ -171,7 +171,7 @@ public void getNumActiveReturnsTheCorrectNumber() {
171171
172172 @ Test
173173 public void closeResourceTwice () {
174- try (JedisPooled pool = JedisPooled .builder ()
174+ try (RedisClient pool = RedisClient .builder ()
175175 .hostAndPort (endpointStandalone7 .getHost (), endpointStandalone7 .getPort ())
176176 .clientConfig (DefaultJedisClientConfig .builder ().timeoutMillis (2000 ).build ())
177177 .poolConfig (new ConnectionPoolConfig ()).build ()) {
@@ -184,7 +184,7 @@ public void closeResourceTwice() {
184184
185185 @ Test
186186 public void closeBrokenResourceTwice () {
187- try (JedisPooled pool = JedisPooled .builder ()
187+ try (RedisClient pool = RedisClient .builder ()
188188 .hostAndPort (endpointStandalone7 .getHost (), endpointStandalone7 .getPort ())
189189 .clientConfig (DefaultJedisClientConfig .builder ().timeoutMillis (2000 ).build ())
190190 .poolConfig (new ConnectionPoolConfig ()).build ()) {
@@ -204,10 +204,10 @@ public void closeBrokenResourceTwice() {
204204
205205 @ Test
206206 public void testResetValidCredentials () {
207- DefaultRedisCredentialsProvider credentialsProvider =
207+ DefaultRedisCredentialsProvider credentialsProvider =
208208 new DefaultRedisCredentialsProvider (new DefaultRedisCredentials (null , "bad password" ));
209209
210- try (JedisPooled pool = JedisPooled .builder ().hostAndPort (endpointStandalone1 .getHostAndPort ())
210+ try (RedisClient pool = RedisClient .builder ().hostAndPort (endpointStandalone1 .getHostAndPort ())
211211 .clientConfig (
212212 DefaultJedisClientConfig .builder ().credentialsProvider (credentialsProvider ).build ())
213213 .build ()) {
@@ -269,7 +269,7 @@ public void cleanUp() {
269269 GenericObjectPoolConfig <Connection > poolConfig = new GenericObjectPoolConfig <>();
270270 poolConfig .setMaxTotal (1 );
271271 poolConfig .setTestOnBorrow (true );
272- try (JedisPooled pool = JedisPooled .builder ().hostAndPort (endpointStandalone1 .getHostAndPort ())
272+ try (RedisClient pool = RedisClient .builder ().hostAndPort (endpointStandalone1 .getHostAndPort ())
273273 .clientConfig (
274274 DefaultJedisClientConfig .builder ().credentialsProvider (credentialsProvider ).build ())
275275 .poolConfig (poolConfig ).build ()) {
0 commit comments