@After public void tearDown() { if (pool != null) { if (pool.getClient() != null) { pool.getClient().shutdown(0, 0, TimeUnit.MILLISECONDS); } pool.destroy(); } }
/** @see DATAREDIS-524 */ @Test public void testCreateSentinelWithPassword() { pool = new DefaultLettucePool( new RedisSentinelConfiguration("mymaster", Collections.singleton("host:1234"))); pool.setClientResources(LettuceTestClientResources.getSharedClientResources()); pool.setPassword("foo"); pool.afterPropertiesSet(); RedisURI redisUri = (RedisURI) getField(pool.getClient(), "redisURI"); assertThat(redisUri.getPassword(), is(equalTo(pool.getPassword().toCharArray()))); }