assertThat(token.getUserId(), is(not(nullValue())));
}
@Test
public void socialLogin() {
OAuth2ConnectionFactory connectionFactory = mock(OAuth2ConnectionFactory.class);
Connection<Facebook> connection = mock(Connection.class);
when(connectionFactoryLocator.getConnectionFactory(any(String.class))).thenReturn(connectionFactory);
when(connectionFactory.createConnection(any(AccessGrant.class))).thenReturn(connection);
when(userService.socialLogin(connection)).thenReturn(
new AuthenticatedUserToken(TEST_USER.getUuid().toString(), AUTH_TOKEN.getToken()));
OAuth2Request request = new OAuth2Request();
request.setAccessToken("123");
ClientResponse response = super.resource().path("user/login/facebook").entity(request, APPLICATION_JSON).accept(APPLICATION_JSON).post(ClientResponse.class);