Search in sources :

Example 1 with OktaStorage

use of com.okta.oidc.storage.OktaStorage 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);
}
Also used : OktaStorage(com.okta.oidc.storage.OktaStorage) SharedPreferenceStorage(com.okta.oidc.storage.SharedPreferenceStorage) MockEndPoint(com.okta.oidc.util.MockEndPoint) Gson(com.google.gson.Gson) EncryptionManagerStub(com.okta.oidc.util.EncryptionManagerStub) SyncWebAuthClient(com.okta.oidc.clients.web.SyncWebAuthClient) HttpClientFactory(com.okta.oidc.util.HttpClientFactory) Before(org.junit.Before)

Aggregations

Gson (com.google.gson.Gson)1 SyncWebAuthClient (com.okta.oidc.clients.web.SyncWebAuthClient)1 OktaStorage (com.okta.oidc.storage.OktaStorage)1 SharedPreferenceStorage (com.okta.oidc.storage.SharedPreferenceStorage)1 EncryptionManagerStub (com.okta.oidc.util.EncryptionManagerStub)1 HttpClientFactory (com.okta.oidc.util.HttpClientFactory)1 MockEndPoint (com.okta.oidc.util.MockEndPoint)1 Before (org.junit.Before)1