Search in sources :

Example 1 with MockSuccessAuthorizationResultNetworkTests

use of com.microsoft.identity.internal.testutils.mocks.MockSuccessAuthorizationResultNetworkTests in project microsoft-authentication-library-common-for-android by AzureAD.

the class ResourceOwnerPasswordCredentialsTestStrategy method requestAuthorization.

/**
 * Template method for executing an OAuth2 authorization request.
 *
 * @param request               microsoft sts authorization request.
 * @param authorizationStrategy authorization strategy.
 * @return GenericAuthorizationResponse
 */
@Override
public Future<AuthorizationResult> requestAuthorization(final MicrosoftStsAuthorizationRequest request, final AuthorizationStrategy authorizationStrategy) {
    final MockSuccessAuthorizationResultNetworkTests authorizationResult = new MockSuccessAuthorizationResultNetworkTests();
    final ResultFuture<AuthorizationResult> future = new ResultFuture<>();
    future.setResult(authorizationResult);
    return future;
}
Also used : ResultFuture(com.microsoft.identity.common.internal.result.ResultFuture) AuthorizationResult(com.microsoft.identity.common.internal.providers.oauth2.AuthorizationResult) MockSuccessAuthorizationResultNetworkTests(com.microsoft.identity.internal.testutils.mocks.MockSuccessAuthorizationResultNetworkTests)

Aggregations

AuthorizationResult (com.microsoft.identity.common.internal.providers.oauth2.AuthorizationResult)1 ResultFuture (com.microsoft.identity.common.internal.result.ResultFuture)1 MockSuccessAuthorizationResultNetworkTests (com.microsoft.identity.internal.testutils.mocks.MockSuccessAuthorizationResultNetworkTests)1