}
@Test
public void removeConnections() throws Exception {
ConnectionFactoryRegistry connectionFactoryLocator = new ConnectionFactoryRegistry();
ConnectionFactory<TestApi2> connectionFactory = new StubOAuth2ConnectionFactory("clientId", "clientSecret", THROW_EXCEPTION);
connectionFactoryLocator.addConnectionFactory(connectionFactory);
StubConnectionRepository connectionRepository = new StubConnectionRepository();
connectionRepository.addConnection(connectionFactory.createConnection(new ConnectionData("provider1", "provider1User1", null, null, null, null, null, null, null)));
connectionRepository.addConnection(connectionFactory.createConnection(new ConnectionData("provider1", "provider1User2", null, null, null, null, null, null, null)));
connectionRepository.addConnection(connectionFactory.createConnection(new ConnectionData("oauth2Provider", "provider2User1", null, null, null, null, null, null, null)));
connectionRepository.addConnection(connectionFactory.createConnection(new ConnectionData("oauth2Provider", "provider2User2", null, null, null, null, null, null, null)));
assertEquals(2, connectionRepository.findConnections("provider1").size());
assertEquals(2, connectionRepository.findConnections("oauth2Provider").size());
ConnectController connectController = new ConnectController(connectionFactoryLocator, connectionRepository);
List<DisconnectInterceptor<?>> interceptors = getDisconnectInterceptor();
connectController.setDisconnectInterceptors(interceptors);