@Test
 public void removeConnection() {
   SocialUserConnection facebookConnection = insertFacebookConnection();
   assertThat(socialUserConnectionRepository.findOne(facebookConnection.getId())).isNotNull();
   connectionRepository.removeConnection(new ConnectionKey("facebook", "9"));
   assertThat(socialUserConnectionRepository.findOne(facebookConnection.getId())).isNull();
 }
 private SocialUserConnection createExistingSocialUserConnection(
     String userId,
     String providerId,
     String providerUserId,
     Long rank,
     String displayName,
     String profileURL,
     String imageURL,
     String accessToken,
     String secret,
     String refreshToken,
     Long expireTime) {
   SocialUserConnection socialUserConnectionToSabe =
       new SocialUserConnection(
           userId,
           providerId,
           providerUserId,
           rank,
           displayName,
           profileURL,
           imageURL,
           accessToken,
           secret,
           refreshToken,
           expireTime);
   return socialUserConnectionRepository.save(socialUserConnectionToSabe);
 }
  @Before
  public void setUp() {
    socialUserConnectionRepository.deleteAll();

    connectionFactoryRegistry = new ConnectionFactoryRegistry();
    connectionFactory = new TestFacebookConnectionFactory();
    connectionFactoryRegistry.addConnectionFactory(connectionFactory);
    usersConnectionRepository =
        new CustomSocialUsersConnectionRepository(
            socialUserConnectionRepository, connectionFactoryRegistry);
    connectionRepository = usersConnectionRepository.createConnectionRepository("1");
  }