Examples of findConnections()


Examples of org.springframework.social.connect.web.test.StubConnectionRepository.findConnections()

    ConnectionFactoryRegistry connectionFactoryLocator = new ConnectionFactoryRegistry();
    ConnectionFactory<TestApi2> connectionFactory = new StubOAuth2ConnectionFactory("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/oauth2Provider").param("code", "oauth2Code"))
      .andExpect(redirectedUrl("/connect/oauth2Provider"))
      .andExpect(request().sessionAttribute("social_provider_error", notNullValue()));
    assertEquals(0, connectionRepository.findConnections("oauth2Provider").size());   
  }
View Full Code Here

Examples of org.springframework.social.connect.web.test.StubConnectionRepository.findConnections()

    MockMvc mockMvc = standaloneSetup(new ConnectController(connectionFactoryLocator, connectionRepository)).build();
    assertEquals(0, connectionRepository.findConnections("oauth2Provider").size());   
    mockMvc.perform(get("/connect/oauth2Provider").param("code", "oauth2Code"))
      .andExpect(redirectedUrl("/connect/oauth2Provider"))
      .andExpect(request().sessionAttribute("social_provider_error", notNullValue()));
    assertEquals(0, connectionRepository.findConnections("oauth2Provider").size());   
  }
 
  @Test
  public void oauth2ErrorCallback() throws Exception {
    ConnectionFactoryRegistry connectionFactoryLocator = new ConnectionFactoryRegistry();
View Full Code Here

Examples of org.springframework.social.connect.web.test.StubConnectionRepository.findConnections()

    ConnectionFactoryRegistry connectionFactoryLocator = new ConnectionFactoryRegistry();
    ConnectionFactory<TestApi2> connectionFactory = new StubOAuth2ConnectionFactory("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());   
    HashMap<String, String> expectedError = new HashMap<String, String>();
    expectedError.put("error", "access_denied");
    expectedError.put("errorDescription", "The user said no.");
    expectedError.put("errorUri", "http://provider.com/user/said/no");
    mockMvc.perform(get("/connect/oauth2Provider").param("error", "access_denied")
View Full Code Here

Examples of org.springframework.social.connect.web.test.StubConnectionRepository.findConnections()

    ConnectionFactoryRegistry connectionFactoryLocator = new ConnectionFactoryRegistry();
    ConnectionFactory<TestApi2> connectionFactory = new StubOAuth2ConnectionFactory("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());   
    HashMap<String, String> expectedError = new HashMap<String, String>();
    expectedError.put("error", "access_denied");
    mockMvc.perform(get("/connect/oauth2Provider").param("error", "access_denied"))
      .andExpect(redirectedUrl("/connect/oauth2Provider"))
      .andExpect(request().sessionAttribute("social_authorization_error", notNullValue()))
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.