}
@Test
public void connectionStatus() throws Exception {
ConnectionFactoryRegistry connectionFactoryLocator = new ConnectionFactoryRegistry();
ConnectionFactory<TestApi1> connectionFactory1 = new StubOAuth1ConnectionFactory("clientId", "clientSecret", THROW_EXCEPTION);
connectionFactoryLocator.addConnectionFactory(connectionFactory1);
ConnectionFactory<TestApi2> connectionFactory2 = new StubOAuth2ConnectionFactory("clientId", "clientSecret", THROW_EXCEPTION);
connectionFactoryLocator.addConnectionFactory(connectionFactory2);
StubConnectionRepository connectionRepository = new StubConnectionRepository();
connectionRepository.addConnection(connectionFactory1.createConnection(new ConnectionData("oauth1Provider", "provider1User1", null, null, null, null, null, null, null)));
MockMvc mockMvc = standaloneSetup(new ConnectController(connectionFactoryLocator, connectionRepository)).build();
mockMvc.perform(get("/connect"))
.andExpect(view().name("connect/status"))
.andExpect(model().attribute("providerIds", new HashSet<String>(asList("oauth1Provider", "oauth2Provider"))))