use of com.okta.oidc.util.MockEndPoint 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);
}
use of com.okta.oidc.util.MockEndPoint 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);
}
use of com.okta.oidc.util.MockEndPoint 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[] { "" };
}
use of com.okta.oidc.util.MockEndPoint in project okta-oidc-android by okta.
the class HttpClientImplTest method setUp.
@Before
public void setUp() throws Exception {
mEndPoint = new MockEndPoint();
String url = mEndPoint.getUrl();
OIDCConfig config = TestValues.getConfigWithUrl(url);
ProviderConfiguration providerConfiguration = TestValues.getProviderConfiguration(url);
TokenResponse tokenResponse = new Gson().fromJson(JsonStrings.TOKEN_RESPONSE, TokenResponse.class);
mHttpClient = new HttpClientImpl();
mRequest = HttpRequestBuilder.newAuthorizedRequest().uri(Uri.parse(mEndPoint.getUrl())).httpRequestMethod(ConnectionParameters.RequestMethod.POST).config(config).providerConfiguration(providerConfiguration).tokenResponse(tokenResponse).createRequest();
}
use of com.okta.oidc.util.MockEndPoint in project okta-oidc-android by okta.
the class ConfigurationRequestTest method setUp.
@Before
public void setUp() throws Exception {
mEndPoint = new MockEndPoint();
String url = mEndPoint.getUrl();
OIDCConfig config = TestValues.getConfigWithUrl(url);
mRequest = HttpRequestBuilder.newConfigurationRequest().config(config).createRequest();
mClientFactory = new HttpClientFactory();
mClientFactory.setClientType(mClientType);
mHttpClient = mClientFactory.build();
OIDCConfig configOAuth2 = TestValues.getConfigWithUrl(url + "/oauth2/default/" + WELL_KNOWN_OAUTH);
mRequestOAuth2 = HttpRequestBuilder.newConfigurationRequest().config(configOAuth2).createRequest();
mCallbackExecutor = Executors.newSingleThreadExecutor();
}
Aggregations