@Test public void shouldUseLDAPUtilsForExternalConfiguration() { PowerMockito.mockStatic(LDAPUtils.class); ConnectionFactory mockConnectionFactory = mock(ConnectionFactory.class); given(LDAPUtils.newFailoverConnectionPool( any(Set.class), anyString(), any(char[].class), anyInt(), anyInt(), anyString(), any(LDAPOptions.class))).willReturn(mockConnectionFactory); given(mockExternal.getStoreMode()).willReturn(ExternalTokenConfig.StoreMode.EXTERNAL); given(mockExternal.getHostname()).willReturn("badger"); given(mockExternal.getMaxConnections()).willReturn("50"); given(mockExternal.getPassword()).willReturn("weasel"); given(mockExternal.getPort()).willReturn("1234"); given(mockExternal.getUsername()).willReturn("ferret"); given(mockExternal.hasChanged()).willReturn(true); factory.updateConnection(); PowerMockito.verifyStatic(); LDAPUtils.newFailoverConnectionPool( any(Set.class), anyString(), any(char[].class), anyInt(), anyInt(), anyString(), any(LDAPOptions.class)); }
public void updateConnection() { try { writeLock.lock(); if (ldapConfig.hasChanged() || external.hasChanged()) { reconfigureConnection(); } } finally { writeLock.unlock(); } }
CTSConnectionFactory implements ConnectionFactory, ShutdownListener { public void updateConnection() { try { writeLock.lock(); if (ldapConfig.hasChanged() || external.hasChanged()) { reconfigureConnection(); } } finally { writeLock.unlock(); } } }
CTSConnectionFactory implements ConnectionFactory, ShutdownListener { public void updateConnection() { try { writeLock.lock(); if (ldapConfig.hasChanged() || external.hasChanged()) { reconfigureConnection(); } } finally { writeLock.unlock(); } } @Inject  CTSConnectionFactory(DataLayerConnectionFactory dlcf, LDAPConfig ldapConfig,
                                ExternalTokenConfig external, @Named(CoreTokenConstants.CTS_DEBUG) Debug debug); }
CTSConnectionFactory implements ConnectionFactory, ShutdownListener { public void updateConnection() { try { writeLock.lock(); if (ldapConfig.hasChanged() || external.hasChanged()) { reconfigureConnection(); } } finally { writeLock.unlock(); } } @Inject  CTSConnectionFactory(DataLayerConnectionFactory dlcf, LDAPConfig ldapConfig,
                                ExternalTokenConfig external, @Named(CoreTokenConstants.CTS_DEBUG) Debug debug); void updateConnection(); Connection getConnection(); FutureResult<Connection> getConnectionAsync(ResultHandler<? super Connection> resultHandler); void close(); void shutdown(); }
CTSConnectionFactory implements ConnectionFactory, ShutdownListener { public void updateConnection() { try { writeLock.lock(); if (ldapConfig.hasChanged() || external.hasChanged()) { reconfigureConnection(); } } finally { writeLock.unlock(); } } @Inject  CTSConnectionFactory(DataLayerConnectionFactory dlcf, LDAPConfig ldapConfig,
                                ExternalTokenConfig external, @Named(CoreTokenConstants.CTS_DEBUG) Debug debug); void updateConnection(); Connection getConnection(); FutureResult<Connection> getConnectionAsync(ResultHandler<? super Connection> resultHandler); void close(); void shutdown();  }