@Test
public void disconnect() throws Exception {
FacebookConnectionFactory connectionFactory = new FacebookConnectionFactory("clientId", CLIENT_SECRET);
Connection<Facebook> connection = connectionFactory.createConnection(new ConnectionData("facebook", "738140579", "", "", "", "", "", "", null));
StubUsersConnectionRepository usersConnectionRepository = new StubUsersConnectionRepository();
ConnectionRepository connectionRepository = usersConnectionRepository.createConnectionRepository("habuma");
connectionRepository.addConnection(connection);
assertEquals(1, connectionRepository.findAllConnections().size());
DisconnectController controller = new DisconnectController(usersConnectionRepository, CLIENT_SECRET);
MockMvc mockMvc = standaloneSetup(controller).build();
mockMvc.perform(post("/disconnect/facebook").param("signed_request", SIGNED_REQUEST))
.andExpect(status().isNoContent());
assertEquals(0, connectionRepository.findAllConnections().size());
}