use of com.okta.oidc.util.MockResultCallback in project okta-oidc-android by okta.
the class SyncAuthClientTest method signOutWithCallback.
@Test
public void signOutWithCallback() throws InterruptedException {
mEndPoint.enqueueReturnSuccessEmptyBody();
mEndPoint.enqueueReturnSuccessEmptyBody();
MockResultCallback<Integer, AuthorizationException> mockCallback = new MockResultCallback<>();
mAuthClient.signOut(mockCallback);
// wait for request to be created
Thread.sleep(200);
RecordedRequest recordedRequest = mEndPoint.takeRequest();
assertThat(recordedRequest.getPath(), equalTo("/revoke?client_id=CLIENT_ID&token=ACCESS_TOKEN"));
recordedRequest = mEndPoint.takeRequest();
assertThat(recordedRequest.getPath(), equalTo("/revoke?client_id=CLIENT_ID&token=REFRESH_TOKEN"));
int status = mockCallback.getResult();
assertEquals(status, SUCCESS);
}
Aggregations