Search in sources :

Example 1 with EncryptionManagerStub

use of com.okta.oidc.util.EncryptionManagerStub in project okta-oidc-android by okta.

the class SyncWebAuthClientTest method setUp.

@Before
public void setUp() throws Exception {
    mContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
    mEndPoint = new MockEndPoint();
    String url = mEndPoint.getUrl();
    mClientFactory = new HttpClientFactory();
    mClientFactory.setClientType(mClientType);
    mHttpClient = mClientFactory.build();
    mConfig = TestValues.getConfigWithUrl(url);
    mStorage = new SharedPreferenceStorage(mContext);
    mGson = new Gson();
    mProviderConfig = TestValues.getProviderConfiguration(url);
    mTokenResponse = TokenResponse.RESTORE.restore(TOKEN_RESPONSE);
    SyncWebAuthClient okta = new Okta.SyncWebAuthBuilder().withConfig(mConfig).withOktaHttpClient(mHttpClient).withContext(mContext).withStorage(mStorage).withEncryptionManager(new EncryptionManagerStub()).create();
    mSyncWebAuth = (SyncWebAuthClientImpl) okta;
    mOktaState = mSyncWebAuth.getOktaState();
    mOktaState.save(mProviderConfig);
}
Also used : SharedPreferenceStorage(com.okta.oidc.storage.SharedPreferenceStorage) MockEndPoint(com.okta.oidc.util.MockEndPoint) Gson(com.google.gson.Gson) EncryptionManagerStub(com.okta.oidc.util.EncryptionManagerStub) HttpClientFactory(com.okta.oidc.util.HttpClientFactory) Before(org.junit.Before)

Example 2 with EncryptionManagerStub

use of com.okta.oidc.util.EncryptionManagerStub in project okta-oidc-android by okta.

the class SessionClientImplTest method setUp.

@Before
public void setUp() throws Exception {
    mContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
    mEndPoint = new MockEndPoint();
    mGson = new Gson();
    mStorage = new SharedPreferenceStorage(mContext);
    String url = mEndPoint.getUrl();
    mClientFactory = new HttpClientFactory();
    mClientFactory.setClientType(mClientType);
    mConfig = TestValues.getConfigWithUrl(url);
    mProviderConfig = TestValues.getProviderConfiguration(url);
    mTokenResponse = TokenResponse.RESTORE.restore(TOKEN_RESPONSE);
    WebAuthClient okta = new Okta.WebAuthBuilder().withCallbackExecutor(mExecutor).withConfig(mConfig).withOktaHttpClient(mClientFactory.build()).withContext(mContext).withStorage(mStorage).withEncryptionManager(new EncryptionManagerStub()).create();
    mSessionClient = okta.getSessionClient();
    OktaState mOktaState = new OktaState(new OktaRepository(mStorage, mContext, new EncryptionManagerStub(), false, false));
    mOktaState.save(mTokenResponse);
    mOktaState.save(mProviderConfig);
}
Also used : SharedPreferenceStorage(com.okta.oidc.storage.SharedPreferenceStorage) OktaState(com.okta.oidc.OktaState) OktaRepository(com.okta.oidc.storage.OktaRepository) MockEndPoint(com.okta.oidc.util.MockEndPoint) Gson(com.google.gson.Gson) WebAuthClient(com.okta.oidc.clients.web.WebAuthClient) EncryptionManagerStub(com.okta.oidc.util.EncryptionManagerStub) Okta(com.okta.oidc.Okta) HttpClientFactory(com.okta.oidc.util.HttpClientFactory) Before(org.junit.Before)

Example 3 with EncryptionManagerStub

use of com.okta.oidc.util.EncryptionManagerStub in project okta-oidc-android by okta.

the class OktaTest method setUp.

@Before
public void setUp() throws Exception {
    mContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
    mStorage = new SharedPreferenceStorage(mContext);
    mHttpClient = new HttpClientImpl();
    mEncryptionManager = new EncryptionManagerStub();
    String url = new MockEndPoint().getUrl();
    mConfig = TestValues.getConfigWithUrl(url);
    tabColor = Color.BLACK;
    supportBrowsers = new String[] { "" };
}
Also used : SharedPreferenceStorage(com.okta.oidc.storage.SharedPreferenceStorage) MockEndPoint(com.okta.oidc.util.MockEndPoint) EncryptionManagerStub(com.okta.oidc.util.EncryptionManagerStub) HttpClientImpl(com.okta.oidc.net.HttpClientImpl) Before(org.junit.Before)

Example 4 with EncryptionManagerStub

use of com.okta.oidc.util.EncryptionManagerStub in project okta-oidc-android by okta.

the class OktaStateTest method setUp.

@Before
public void setUp() throws Exception {
    mContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
    mOktaStorageMock = new OktaStorageMock(mContext, false);
    mOktaRepository = new OktaRepository(mOktaStorageMock, mContext, new EncryptionManagerStub(), false, false);
    mOktaState = new OktaState(mOktaRepository);
}
Also used : OktaStorageMock(com.okta.oidc.util.OktaStorageMock) OktaRepository(com.okta.oidc.storage.OktaRepository) EncryptionManagerStub(com.okta.oidc.util.EncryptionManagerStub) Before(org.junit.Before)

Example 5 with EncryptionManagerStub

use of com.okta.oidc.util.EncryptionManagerStub in project okta-oidc-android by okta.

the class OktaRepositoryTest method setUp.

@Before
public void setUp() throws Exception {
    mContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
    mHardwareEncryption = new EncryptionManagerStub(true);
    mSoftwareEncryption = new EncryptionManagerStub(false);
    mOktaStorageSoftware = new OktaStorageMock(mContext, PREF_NAME_SOFTWARE, false);
    mOktaStorageHardware = new OktaStorageMock(mContext, PREF_NAME_HARDWARE, true);
}
Also used : OktaStorageMock(com.okta.oidc.util.OktaStorageMock) EncryptionManagerStub(com.okta.oidc.util.EncryptionManagerStub) Before(org.junit.Before)

Aggregations

EncryptionManagerStub (com.okta.oidc.util.EncryptionManagerStub)8 Before (org.junit.Before)7 SharedPreferenceStorage (com.okta.oidc.storage.SharedPreferenceStorage)6 MockEndPoint (com.okta.oidc.util.MockEndPoint)5 HttpClientFactory (com.okta.oidc.util.HttpClientFactory)4 Gson (com.google.gson.Gson)3 SyncWebAuthClient (com.okta.oidc.clients.web.SyncWebAuthClient)2 OktaRepository (com.okta.oidc.storage.OktaRepository)2 OktaStorageMock (com.okta.oidc.util.OktaStorageMock)2 OIDCConfig (com.okta.oidc.OIDCConfig)1 Okta (com.okta.oidc.Okta)1 OktaState (com.okta.oidc.OktaState)1 WebAuthClient (com.okta.oidc.clients.web.WebAuthClient)1 HttpClientImpl (com.okta.oidc.net.HttpClientImpl)1 AuthorizedRequest (com.okta.oidc.net.request.AuthorizedRequest)1 OktaStorage (com.okta.oidc.storage.OktaStorage)1 Test (org.junit.Test)1