}
@Test
public void oauth1Callback_exceptionWhileFetchingAccessToken() throws Exception {
ConnectionFactoryRegistry connectionFactoryLocator = new ConnectionFactoryRegistry();
ConnectionFactory<TestApi1> connectionFactory = new StubOAuth1ConnectionFactory("clientId", "clientSecret", THROW_EXCEPTION);
connectionFactoryLocator.addConnectionFactory(connectionFactory);
StubConnectionRepository connectionRepository = new StubConnectionRepository();
MockMvc mockMvc = standaloneSetup(new ConnectController(connectionFactoryLocator, connectionRepository)).build();
assertEquals(0, connectionRepository.findConnections("oauth2Provider").size());
mockMvc.perform(get("/connect/oauth1Provider")