@Test
public void synchronouslyRefreshCognitoTokenIsValid() {

    Mockito.when(identityManager.getMe()).thenReturn(Observable.just(meResponse));
    Mockito.when(user.getCognitoToken()).thenReturn(TOKEN);
    Mockito.when(user.getIdentityId()).thenReturn(IDENTITY_ID);
    Mockito.when(user.getCognitoTokenExpiresAt()).thenReturn(EXPIRES_AT);
    final Cognito cognito = new Cognito(TOKEN, IDENTITY_ID, EXPIRES_AT);
    assertEquals(cognito, cognitoIdentityProvider.synchronouslyRefreshCognitoToken());
}