@@ -31,13 +31,13 @@ public class JedisTest {
3131 public JedisTest () {
3232 jedis = new Jedis ();
3333 }
34-
34+
3535 @ BeforeClass
3636 public static void setUp () throws IOException {
3737 redisServer = new RedisServer (6379 );
3838 redisServer .start ();
3939 }
40-
40+
4141 @ AfterClass
4242 public static void destroy () {
4343 redisServer .stop ();
@@ -186,40 +186,40 @@ public void givenMultipleIndependentOperationsWhenNetworkOptimizationIsImportant
186186 Assert .assertTrue (pipeExists .get ());
187187 Assert .assertEquals (2 , pipeRanking .get ().size ());
188188 }
189-
189+
190190 @ Test
191191 public void givenAPoolConfigurationThenCreateAJedisPool () {
192192 final JedisPoolConfig poolConfig = buildPoolConfig ();
193-
194- try (JedisPool jedisPool = new JedisPool (poolConfig , "localhost" );
195- Jedis jedis = jedisPool . getResource ()) {
196-
197- // do simple operation to verify that the Jedis resource is working properly
193+
194+ try (JedisPool jedisPool = new JedisPool (poolConfig , "localhost" ); Jedis jedis = jedisPool . getResource ()) {
195+
196+ // do simple operation to verify that the Jedis resource is working
197+ // properly
198198 String key = "key" ;
199199 String value = "value" ;
200200
201201 jedis .set (key , value );
202202 String value2 = jedis .get (key );
203203
204204 Assert .assertEquals (value , value2 );
205-
205+
206206 // flush Redis
207207 jedis .flushAll ();
208208 }
209209 }
210-
210+
211211 private JedisPoolConfig buildPoolConfig () {
212- final JedisPoolConfig poolConfig = new JedisPoolConfig ();
213- poolConfig .setMaxTotal (128 );
214- poolConfig .setMaxIdle (128 );
215- poolConfig .setMinIdle (16 );
216- poolConfig .setTestOnBorrow (true );
217- poolConfig .setTestOnReturn (true );
218- poolConfig .setTestWhileIdle (true );
219- poolConfig .setMinEvictableIdleTimeMillis (Duration .ofSeconds (60 ).toMillis ());
220- poolConfig .setTimeBetweenEvictionRunsMillis (Duration .ofSeconds (30 ).toMillis ());
221- poolConfig .setNumTestsPerEvictionRun (3 );
222- poolConfig .setBlockWhenExhausted (true );
223- return poolConfig ;
224- }
212+ final JedisPoolConfig poolConfig = new JedisPoolConfig ();
213+ poolConfig .setMaxTotal (128 );
214+ poolConfig .setMaxIdle (128 );
215+ poolConfig .setMinIdle (16 );
216+ poolConfig .setTestOnBorrow (true );
217+ poolConfig .setTestOnReturn (true );
218+ poolConfig .setTestWhileIdle (true );
219+ poolConfig .setMinEvictableIdleTimeMillis (Duration .ofSeconds (60 ).toMillis ());
220+ poolConfig .setTimeBetweenEvictionRunsMillis (Duration .ofSeconds (30 ).toMillis ());
221+ poolConfig .setNumTestsPerEvictionRun (3 );
222+ poolConfig .setBlockWhenExhausted (true );
223+ return poolConfig ;
224+ }
225225}
0 commit comments