// OAuth 2
@Test
public void signIn_OAuth2Provider() throws Exception {
ConnectionFactoryRegistry connectionFactoryLocator = new ConnectionFactoryRegistry();
ConnectionFactory<TestApi2> connectionFactory2 = new StubOAuth2ConnectionFactory("clientId", "clientSecret");
connectionFactoryLocator.addConnectionFactory(connectionFactory2);
StubUsersConnectionRepository usersConnectionRepository = new StubUsersConnectionRepository();
usersConnectionRepository.createConnectionRepository("habuma").addConnection(connectionFactory2.createConnection(
new ConnectionData("oauth2Provider", "provider2User1", null, null, null, null, null, null, null)));
ProviderSignInController providerSignInController = new ProviderSignInController(connectionFactoryLocator, usersConnectionRepository, null);
providerSignInController.afterPropertiesSet();
MockMvc mockMvc = standaloneSetup(providerSignInController).build();
mockMvc.perform(post("/signin/oauth2Provider"))