Search in sources :

Example 11 with MockEndPoint

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

the class OktaResultFragmentTest method setUp.

@Before
public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    mContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
    mEndPoint = new MockEndPoint();
    String url = mEndPoint.getUrl();
    mConfig = TestValues.getConfigWithUrl(url);
    mProviderConfig = TestValues.getProviderConfiguration(url);
    mActivity = Robolectric.buildActivity(FragmentActivity.class).setup().get();
}
Also used : FragmentActivity(androidx.fragment.app.FragmentActivity) MockEndPoint(com.okta.oidc.util.MockEndPoint) Before(org.junit.Before)

Example 12 with MockEndPoint

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

the class BaseRequestTest method setUp.

@Before
public void setUp() throws Exception {
    mEndPoint = new MockEndPoint();
    mRequest = new BaseRequest<String, AuthorizationException>() {

        @Override
        public String executeRequest(OktaHttpClient client) throws AuthorizationException {
            return null;
        }
    };
    mClientFactory = new HttpClientFactory();
    mClientFactory.setClientType(mClientType);
    mHttpClient = mClientFactory.build();
}
Also used : OktaHttpClient(com.okta.oidc.net.OktaHttpClient) AuthorizationException(com.okta.oidc.util.AuthorizationException) MockEndPoint(com.okta.oidc.util.MockEndPoint) HttpClientFactory(com.okta.oidc.util.HttpClientFactory) Before(org.junit.Before)

Example 13 with MockEndPoint

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

the class NativeAuthorizeRequestTest 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.getNativeLogInRequest(config, SESSION_TOKEN, mProviderConfig);
    mClientFactory = new HttpClientFactory();
    mClientFactory.setClientType(mClientType);
    mHttpClient = mClientFactory.build();
}
Also used : MockEndPoint(com.okta.oidc.util.MockEndPoint) OIDCConfig(com.okta.oidc.OIDCConfig) HttpClientFactory(com.okta.oidc.util.HttpClientFactory) Before(org.junit.Before)

Example 14 with MockEndPoint

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

the class RefreshTokenRequestTest method setUp.

@Before
public void setUp() throws Exception {
    mEndPoint = new MockEndPoint();
    String url = mEndPoint.getUrl();
    mConfig = TestValues.getConfigWithUrl(url);
    mTokenResponse = TokenResponse.RESTORE.restore(TOKEN_RESPONSE);
    mProviderConfig = TestValues.getProviderConfiguration(url);
    mRequest = TestValues.getRefreshRequest(mConfig, mTokenResponse, mProviderConfig);
    mClientFactory = new HttpClientFactory();
    mClientFactory.setClientType(mClientType);
    mHttpClient = mClientFactory.build();
}
Also used : MockEndPoint(com.okta.oidc.util.MockEndPoint) HttpClientFactory(com.okta.oidc.util.HttpClientFactory) Before(org.junit.Before)

Example 15 with MockEndPoint

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

the class AuthorizedRequestTest method setUp.

@Before
public void setUp() throws Exception {
    mEndPoint = new MockEndPoint();
    String url = mEndPoint.getUrl();
    OIDCConfig config = TestValues.getConfigWithUrl(url);
    mProviderConfig = TestValues.getProviderConfiguration(url);
    mTokenResponse = new Gson().fromJson(JsonStrings.TOKEN_RESPONSE, TokenResponse.class);
    mClientFactory = new HttpClientFactory();
    mClientFactory.setClientType(mClientType);
    mHttpClient = mClientFactory.build();
    mRequest = HttpRequestBuilder.newAuthorizedRequest().uri(Uri.parse(mEndPoint.getUrl())).httpRequestMethod(ConnectionParameters.RequestMethod.POST).config(config).providerConfiguration(mProviderConfig).tokenResponse(mTokenResponse).createRequest();
}
Also used : TokenResponse(com.okta.oidc.net.response.TokenResponse) MockEndPoint(com.okta.oidc.util.MockEndPoint) OIDCConfig(com.okta.oidc.OIDCConfig) Gson(com.google.gson.Gson) HttpClientFactory(com.okta.oidc.util.HttpClientFactory) Before(org.junit.Before)

Aggregations

MockEndPoint (com.okta.oidc.util.MockEndPoint)15 Before (org.junit.Before)15 HttpClientFactory (com.okta.oidc.util.HttpClientFactory)12 OIDCConfig (com.okta.oidc.OIDCConfig)6 Gson (com.google.gson.Gson)5 SharedPreferenceStorage (com.okta.oidc.storage.SharedPreferenceStorage)5 EncryptionManagerStub (com.okta.oidc.util.EncryptionManagerStub)5 TokenResponse (com.okta.oidc.net.response.TokenResponse)2 FragmentActivity (androidx.fragment.app.FragmentActivity)1 Okta (com.okta.oidc.Okta)1 OktaState (com.okta.oidc.OktaState)1 SyncWebAuthClient (com.okta.oidc.clients.web.SyncWebAuthClient)1 WebAuthClient (com.okta.oidc.clients.web.WebAuthClient)1 HttpClientImpl (com.okta.oidc.net.HttpClientImpl)1 OktaHttpClient (com.okta.oidc.net.OktaHttpClient)1 ProviderConfiguration (com.okta.oidc.net.request.ProviderConfiguration)1 OktaRepository (com.okta.oidc.storage.OktaRepository)1 OktaStorage (com.okta.oidc.storage.OktaStorage)1 AuthorizationException (com.okta.oidc.util.AuthorizationException)1