use of com.okta.oidc.net.response.IntrospectInfo in project okta-oidc-android by okta.
the class SessionClientImplTest method introspectToken.
@Test
public void introspectToken() throws InterruptedException {
mEndPoint.enqueueIntrospectSuccess();
final CountDownLatch latch = new CountDownLatch(1);
MockRequestCallback<IntrospectInfo, AuthorizationException> cb = new MockRequestCallback<>(latch);
mSessionClient.introspectToken(ACCESS_TOKEN, TokenTypeHint.ACCESS_TOKEN, cb);
latch.await();
assertNotNull(cb.getResult());
assertTrue(cb.getResult().isActive());
}
use of com.okta.oidc.net.response.IntrospectInfo in project okta-oidc-android by okta.
the class SessionClientImplTest method introspectTokenFailure.
@Test
public void introspectTokenFailure() throws InterruptedException {
mEndPoint.enqueueReturnInvalidClient();
final CountDownLatch latch = new CountDownLatch(1);
MockRequestCallback<IntrospectInfo, AuthorizationException> cb = new MockRequestCallback<>(latch);
mSessionClient.introspectToken(ACCESS_TOKEN, TokenTypeHint.ACCESS_TOKEN, cb);
latch.await();
assertNull(cb.getResult());
assertNotNull(cb.getException());
}
use of com.okta.oidc.net.response.IntrospectInfo in project okta-oidc-android by okta.
the class SyncSessionClientImplTest method introspectTokenFailure.
@Test
public void introspectTokenFailure() throws AuthorizationException, InterruptedException, OktaRepository.EncryptionException {
mExpectedEx.expect(AuthorizationException.class);
mEndPoint.enqueueReturnInvalidClient();
IntrospectRequest request = mSyncSessionClientImpl.introspectTokenRequest(ACCESS_TOKEN, TokenTypeHint.ACCESS_TOKEN, mOktaState.getProviderConfiguration());
IntrospectInfo response = request.executeRequest(mHttpClient);
assertNull(response);
}
Aggregations