use of com.okta.oidc.util.MockEndPoint in project okta-oidc-android by okta.
the class IntrospectRequestTest method setUp.
@Before
public void setUp() throws Exception {
mEndPoint = new MockEndPoint();
String url = mEndPoint.getUrl();
OIDCConfig config = TestValues.getConfigWithUrl(url);
mProviderConfig = getProviderConfiguration(url);
mRequest = TestValues.getIntrospectTokenRequest(config, ACCESS_TOKEN, TokenTypeHint.ACCESS_TOKEN, mProviderConfig);
mClientFactory = new HttpClientFactory();
mClientFactory.setClientType(mClientType);
mHttpClient = mClientFactory.build();
}
use of com.okta.oidc.util.MockEndPoint in project okta-oidc-android by okta.
the class RevokeTokenRequestTest method setUp.
@Before
public void setUp() throws Exception {
mEndPoint = new MockEndPoint();
String url = mEndPoint.getUrl();
OIDCConfig config = TestValues.getConfigWithUrl(url);
mProviderConfig = getProviderConfiguration(url);
mRequest = TestValues.getRevokeTokenRequest(config, ACCESS_TOKEN, mProviderConfig);
mClientFactory = new HttpClientFactory();
mClientFactory.setClientType(mClientType);
mHttpClient = mClientFactory.build();
}
use of com.okta.oidc.util.MockEndPoint in project okta-oidc-android by okta.
the class TokenRequestTest method setUp.
@Before
public void setUp() throws Exception {
mEndPoint = new MockEndPoint();
String url = mEndPoint.getUrl();
mConfig = TestValues.getConfigWithUrl(url);
mProviderConfig = TestValues.getProviderConfiguration(url);
mRequest = TestValues.getTokenRequest(mConfig, getAuthorizeRequest(mConfig, CodeVerifierUtil.generateRandomCodeVerifier()), getAuthorizeResponse(CUSTOM_STATE, CUSTOM_CODE), mProviderConfig);
mClientFactory = new HttpClientFactory();
mClientFactory.setClientType(mClientType);
mHttpClient = mClientFactory.build();
}
use of com.okta.oidc.util.MockEndPoint in project okta-oidc-android by okta.
the class SyncAuthClientTest method setUp.
@Before
public void setUp() throws Exception {
mContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
mEndPoint = new MockEndPoint();
String url = mEndPoint.getUrl();
mConfig = TestValues.getConfigWithUrl(url);
mStorage = new SharedPreferenceStorage(mContext);
mClientFactory = new HttpClientFactory();
mClientFactory.setClientType(mClientType);
mHttpClient = mClientFactory.build();
mProviderConfig = TestValues.getProviderConfiguration(url);
SyncAuthClient okta = new Okta.SyncAuthBuilder().withConfig(mConfig).withOktaHttpClient(mHttpClient).withContext(mContext).withStorage(mStorage).withEncryptionManager(new EncryptionManagerStub()).create();
mSyncNativeAuth = (SyncAuthClientImpl) okta;
mCallbackExecutor = Executors.newSingleThreadExecutor();
mAuthClient = new Okta.AuthBuilder().withConfig(mConfig).withOktaHttpClient(mHttpClient).withContext(mContext).withStorage(mStorage).withCallbackExecutor(mCallbackExecutor).withEncryptionManager(new EncryptionManagerStub()).create();
mOktaState = mSyncNativeAuth.getOktaState();
mOktaState.save(mProviderConfig);
mOktaState.save(TokenResponse.RESTORE.restore(TOKEN_RESPONSE));
}
use of com.okta.oidc.util.MockEndPoint in project okta-oidc-android by okta.
the class SyncSessionClientImplTest method setUp.
@Before
public void setUp() throws Exception {
mContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
mEndPoint = new MockEndPoint();
String url = mEndPoint.getUrl();
mConfig = TestValues.getConfigWithUrl(url);
mGson = new Gson();
OktaStorage storage = new SharedPreferenceStorage(mContext);
mProviderConfig = TestValues.getProviderConfiguration(url);
mTokenResponse = TokenResponse.RESTORE.restore(TOKEN_RESPONSE);
mClientFactory = new HttpClientFactory();
mClientFactory.setClientType(mClientType);
mHttpClient = mClientFactory.build();
SyncWebAuthClient mSyncWebAuth = new Okta.SyncWebAuthBuilder().withConfig(mConfig).withOktaHttpClient(mHttpClient).withContext(mContext).withStorage(storage).withEncryptionManager(new EncryptionManagerStub()).create();
mSyncSessionClientImpl = (SyncSessionClientImpl) mSyncWebAuth.getSessionClient();
mOktaState = mSyncSessionClientImpl.getOktaState();
mOktaState.save(mProviderConfig);
}
Aggregations