diff --git a/MSAL/test/integration/native_auth/MockAPIHandlerTest.swift b/MSAL/test/integration/native_auth/MockAPIHandlerTest.swift index d28fced0f2..8320154237 100644 --- a/MSAL/test/integration/native_auth/MockAPIHandlerTest.swift +++ b/MSAL/test/integration/native_auth/MockAPIHandlerTest.swift @@ -28,7 +28,7 @@ final class MockAPIHandlerTest: MSALNativeAuthIntegrationBaseTests { func testAddNewResponse() async { do { - try await mockAPIHandler.addResponse(endpoint: .signInInitiate, correlationId: correlationId, responses: [.invalidClient, .userNotFound]) + try await mockAPIHandler.addResponse(endpoint: .signInInitiate, correlationId: correlationId, responses: [.unauthorizedClient, .userNotFound]) } catch { XCTFail("Unexpected error: \(error)") } diff --git a/MSAL/test/integration/native_auth/common/MSALNativeAuthIntegrationBaseTests.swift b/MSAL/test/integration/native_auth/common/MSALNativeAuthIntegrationBaseTests.swift index 2e745ea452..80fc26d530 100644 --- a/MSAL/test/integration/native_auth/common/MSALNativeAuthIntegrationBaseTests.swift +++ b/MSAL/test/integration/native_auth/common/MSALNativeAuthIntegrationBaseTests.swift @@ -31,9 +31,14 @@ class MSALNativeAuthIntegrationBaseTests: XCTestCase { var defaultTimeout: TimeInterval = 5 let mockAPIHandler = MockAPIHandler() let correlationId = UUID() - let config: MSALNativeAuthConfiguration = try! MSALNativeAuthConfiguration(clientId: UUID().uuidString, - authority: MSALCIAMAuthority(url: URL(string: (ProcessInfo.processInfo.environment["authorityURL"] ?? "") + "/test")!), - challengeTypes: [.password, .oob, .redirect]) + let config: MSALNativeAuthConfiguration = try! MSALNativeAuthConfiguration( + clientId: UUID().uuidString, + authority: MSALCIAMAuthority(url: + URL(string: (ProcessInfo.processInfo.environment["authorityURL"] ?? "") + "/testTenant")!), + + challengeTypes: [.password, .oob, .redirect], + redirectUri: nil + ) var sut: MSIDHttpRequest! override func tearDown() { @@ -76,7 +81,7 @@ class MSALNativeAuthIntegrationBaseTests: XCTestCase { try await mockResponse(response, endpoint: endpoint) let response: Error = try await perform_uncheckedTestFail() - XCTAssertEqual(response.error?.rawValue, expectedError.error?.rawValue) + XCTAssertEqual(response.error.rawValue, expectedError.error.rawValue) // TODO: Fix these checks if expectedError.errorDescription != nil { diff --git a/MSAL/test/integration/native_auth/common/Model.swift b/MSAL/test/integration/native_auth/common/Model.swift index 81621c8395..ffc452dec6 100644 --- a/MSAL/test/integration/native_auth/common/Model.swift +++ b/MSAL/test/integration/native_auth/common/Model.swift @@ -53,7 +53,6 @@ enum MockAPIResponse: String { case invalidGrant = "InvalidGrant" case invalidScope = "InvalidScope" case expiredToken = "ExpiredToken" - case invalidPurposeToken = "InvalidPurposeToken" case authNotSupported = "AuthNotSupported" case userAlreadyExists = "UserAlreadyExists" case userNotFound = "UserNotFound" diff --git a/MSAL/test/integration/native_auth/end_to_end/MSALNativeAuthEndToEndBaseTestCase.swift b/MSAL/test/integration/native_auth/end_to_end/MSALNativeAuthEndToEndBaseTestCase.swift index e38db0189f..28c52b0bf9 100644 --- a/MSAL/test/integration/native_auth/end_to_end/MSALNativeAuthEndToEndBaseTestCase.swift +++ b/MSAL/test/integration/native_auth/end_to_end/MSALNativeAuthEndToEndBaseTestCase.swift @@ -36,9 +36,6 @@ class MSALNativeAuthEndToEndBaseTestCase: XCTestCase { class Configuration: NSObject { static let clientId = ProcessInfo.processInfo.environment["clientId"] ?? "" static let authorityURLString = ProcessInfo.processInfo.environment["authorityURL"] ?? "" - static let authorityURL = URL(string: authorityURLString) ?? URL(string: "https://microsoft.com") - - static let authority = try? MSALCIAMAuthority(url: authorityURL!) } func mockResponse(_ response: MockAPIResponse, endpoint: MockAPIEndpoint) async throws { @@ -55,19 +52,24 @@ class MSALNativeAuthEndToEndBaseTestCase: XCTestCase { override func setUpWithError() throws { try super.setUpWithError() + let useMockAPIBooleanString = ProcessInfo.processInfo.environment["useMockAPI"] ?? "false" + usingMockAPI = Bool(useMockAPIBooleanString) ?? false + + // mock API URL needs to contains a tenant + guard let authorityURL = URL(string: Configuration.authorityURLString + (usingMockAPI ? "/testTenant" : "")), let authority = try? MSALCIAMAuthority(url: authorityURL) else { + XCTFail("AuthorityURL not set or invalid") + return + } sut = try MSALNativeAuthPublicClientApplication( configuration: MSALPublicClientApplicationConfig( clientId: Configuration.clientId, redirectUri: nil, - authority: Configuration.authority + authority: authority ), challengeTypes: [.OOB, .password] ) - let useMockAPIBooleanString = ProcessInfo.processInfo.environment["useMockAPI"] ?? "false" - usingMockAPI = Bool(useMockAPIBooleanString) ?? false - if usingMockAPI { print("🤖🤖🤖 Using mock API: \(Configuration.authorityURLString)") } else { diff --git a/MSAL/test/integration/native_auth/end_to_end/reset_password/MSALNativeAuthResetPasswordEndToEndTests.swift b/MSAL/test/integration/native_auth/end_to_end/reset_password/MSALNativeAuthResetPasswordEndToEndTests.swift index f562ef438e..b44cf764f8 100644 --- a/MSAL/test/integration/native_auth/end_to_end/reset_password/MSALNativeAuthResetPasswordEndToEndTests.swift +++ b/MSAL/test/integration/native_auth/end_to_end/reset_password/MSALNativeAuthResetPasswordEndToEndTests.swift @@ -81,8 +81,6 @@ final class MSALNativeAuthResetPasswordEndToEndTests: MSALNativeAuthEndToEndBase // SSPR - with automatic sign in func test_resetPassword_withAutomaticSignIn_succeeds() async throws { - try XCTSkipIf(true) // TODO: Remove once we update to continuation_token - let codeRequiredExp = expectation(description: "code required") let resetPasswordStartDelegate = ResetPasswordStartDelegateSpy(expectation: codeRequiredExp) @@ -141,7 +139,5 @@ final class MSALNativeAuthResetPasswordEndToEndTests: MSALNativeAuthEndToEndBase XCTAssertEqual(signInAfterResetPasswordDelegate.result?.account.username, usernameOTP) XCTAssertNotNil(signInAfterResetPasswordDelegate.result?.idToken) XCTAssertNil(signInAfterResetPasswordDelegate.result?.account.accountClaims) - XCTAssertEqual(signInAfterResetPasswordDelegate.result?.scopes[0], "openid") - XCTAssertEqual(signInAfterResetPasswordDelegate.result?.scopes[1], "offline_access") } } diff --git a/MSAL/test/integration/native_auth/end_to_end/sign_in/MSALNativeAuthSignInUsernameEndToEndTests.swift b/MSAL/test/integration/native_auth/end_to_end/sign_in/MSALNativeAuthSignInUsernameEndToEndTests.swift index 3cfe3c5238..b3428cffba 100644 --- a/MSAL/test/integration/native_auth/end_to_end/sign_in/MSALNativeAuthSignInUsernameEndToEndTests.swift +++ b/MSAL/test/integration/native_auth/end_to_end/sign_in/MSALNativeAuthSignInUsernameEndToEndTests.swift @@ -103,7 +103,7 @@ final class MSALNativeAuthSignInUsernameEndToEndTests: MSALNativeAuthEndToEndBas XCTAssertTrue(signInVerifyCodeDelegateSpy.onSignInVerifyCodeErrorCalled) XCTAssertNotNil(signInVerifyCodeDelegateSpy.error) - XCTAssertTrue(signInVerifyCodeDelegateSpy.error!.isInvalidCode) + XCTAssertEqual(signInVerifyCodeDelegateSpy.error?.isInvalidCode, true) } // Hero Scenario 1.2.1. Sign in (Email & Email OTP) @@ -204,7 +204,7 @@ final class MSALNativeAuthSignInUsernameEndToEndTests: MSALNativeAuthEndToEndBas await fulfillment(of: [passwordRequiredExpectation], timeout: 2) XCTAssertTrue(signInPasswordRequiredDelegateSpy.onSignInPasswordRequiredErrorCalled) - XCTAssertTrue(signInPasswordRequiredDelegateSpy.error!.isInvalidPassword) + XCTAssertEqual(signInPasswordRequiredDelegateSpy.error?.isInvalidPassword, true) } // Hero Scenario 2.2.2. Sign in – Email and Password on MULTIPLE screens (Email & Password) diff --git a/MSAL/test/integration/native_auth/end_to_end/sign_up/MSALNativeAuthSignUpUsernameAndPasswordEndToEndTests.swift b/MSAL/test/integration/native_auth/end_to_end/sign_up/MSALNativeAuthSignUpUsernameAndPasswordEndToEndTests.swift index 3505dff41d..0478222059 100644 --- a/MSAL/test/integration/native_auth/end_to_end/sign_up/MSALNativeAuthSignUpUsernameAndPasswordEndToEndTests.swift +++ b/MSAL/test/integration/native_auth/end_to_end/sign_up/MSALNativeAuthSignUpUsernameAndPasswordEndToEndTests.swift @@ -433,7 +433,5 @@ final class MSALNativeAuthSignUpUsernameAndPasswordEndToEndTests: MSALNativeAuth XCTAssertEqual(delegate.result?.account.username, usernamePassword) XCTAssertNotNil(delegate.result?.idToken) XCTAssertNil(delegate.result?.account.accountClaims) - XCTAssertEqual(delegate.result?.scopes[0], "openid") - XCTAssertEqual(delegate.result?.scopes[1], "offline_access") } } diff --git a/MSAL/test/integration/native_auth/end_to_end/sign_up/MSALNativeAuthSignUpUsernameEndToEndTests.swift b/MSAL/test/integration/native_auth/end_to_end/sign_up/MSALNativeAuthSignUpUsernameEndToEndTests.swift index 6af5c2631f..86c8ea33c9 100644 --- a/MSAL/test/integration/native_auth/end_to_end/sign_up/MSALNativeAuthSignUpUsernameEndToEndTests.swift +++ b/MSAL/test/integration/native_auth/end_to_end/sign_up/MSALNativeAuthSignUpUsernameEndToEndTests.swift @@ -304,7 +304,5 @@ final class MSALNativeAuthSignUpUsernameEndToEndTests: MSALNativeAuthEndToEndBas XCTAssertEqual(delegate.result?.account.username, usernameOTP) XCTAssertNotNil(delegate.result?.idToken) XCTAssertNil(delegate.result?.account.accountClaims) - XCTAssertEqual(delegate.result?.scopes[0], "openid") - XCTAssertEqual(delegate.result?.scopes[1], "offline_access") } } diff --git a/MSAL/test/integration/native_auth/requests/reset_password/MSALNativeAuthResetPasswordChallengeIntegrationTests.swift b/MSAL/test/integration/native_auth/requests/reset_password/MSALNativeAuthResetPasswordChallengeIntegrationTests.swift index c9b7e5e547..ab3579e39d 100644 --- a/MSAL/test/integration/native_auth/requests/reset_password/MSALNativeAuthResetPasswordChallengeIntegrationTests.swift +++ b/MSAL/test/integration/native_auth/requests/reset_password/MSALNativeAuthResetPasswordChallengeIntegrationTests.swift @@ -75,8 +75,6 @@ final class MSALNativeAuthResetPasswordChallengeIntegrationTests: MSALNativeAuth } func test_resetPasswordChallenge_unauthorizedClient() async throws { - throw XCTSkip() - try await perform_testFail( endpoint: .resetPasswordChallenge, response: .unauthorizedClient, @@ -92,16 +90,6 @@ final class MSALNativeAuthResetPasswordChallengeIntegrationTests: MSALNativeAuth ) } - func test_resetPasswordChallenge_invalidContinuationToken() async throws { - throw XCTSkip() - - try await perform_testFail( - endpoint: .resetPasswordChallenge, - response: .invalidContinuationToken, - expectedError: createError(.invalidRequest) - ) - } - func test_resetPasswordChallenge_unsupportedChallengeType() async throws { try await perform_testFail( endpoint: .resetPasswordChallenge, diff --git a/MSAL/test/integration/native_auth/requests/reset_password/MSALNativeAuthResetPasswordContinueIntegrationTests.swift b/MSAL/test/integration/native_auth/requests/reset_password/MSALNativeAuthResetPasswordContinueIntegrationTests.swift index 1f39062e95..d37a481028 100644 --- a/MSAL/test/integration/native_auth/requests/reset_password/MSALNativeAuthResetPasswordContinueIntegrationTests.swift +++ b/MSAL/test/integration/native_auth/requests/reset_password/MSALNativeAuthResetPasswordContinueIntegrationTests.swift @@ -62,8 +62,6 @@ final class MSALNativeAuthResetPasswordContinueIntegrationTests: MSALNativeAuthI } func test_resetPasswordContinue_unauthorizedClient() async throws { - throw XCTSkip() - try await perform_testFail( endpoint: .resetPasswordContinue, response: .unauthorizedClient, @@ -79,16 +77,6 @@ final class MSALNativeAuthResetPasswordContinueIntegrationTests: MSALNativeAuthI ) } - func test_resetPasswordContinue_invalidContinuationToken() async throws { - throw XCTSkip() - - try await perform_testFail( - endpoint: .resetPasswordContinue, - response: .invalidContinuationToken, - expectedError: createResetPasswordContinueError(error: .invalidRequest) - ) - } - func test_resetPasswordContinue_invalidPassword() async throws { try await perform_testFail( endpoint: .resetPasswordContinue, @@ -105,16 +93,6 @@ final class MSALNativeAuthResetPasswordContinueIntegrationTests: MSALNativeAuthI ) } - func test_resetPasswordContinue_verificationRequired() async throws { - throw XCTSkip() - - try await perform_testFail( - endpoint: .resetPasswordContinue, - response: .verificationRequired, - expectedError: createResetPasswordContinueError(error: .verificationRequired) - ) - } - private func createResetPasswordContinueError( error: MSALNativeAuthResetPasswordContinueOauth2ErrorCode, subError: MSALNativeAuthSubErrorCode? = nil, diff --git a/MSAL/test/integration/native_auth/requests/reset_password/MSALNativeAuthResetPasswordPollCompletionIntegrationTests.swift b/MSAL/test/integration/native_auth/requests/reset_password/MSALNativeAuthResetPasswordPollCompletionIntegrationTests.swift index 67c1a172b8..0f2e2cfe31 100644 --- a/MSAL/test/integration/native_auth/requests/reset_password/MSALNativeAuthResetPasswordPollCompletionIntegrationTests.swift +++ b/MSAL/test/integration/native_auth/requests/reset_password/MSALNativeAuthResetPasswordPollCompletionIntegrationTests.swift @@ -104,8 +104,6 @@ final class MSALNativeAuthResetPasswordPollCompletionIntegrationTests: MSALNativ } func test_resetPasswordPollCompletion_unauthorizedClient() async throws { - throw XCTSkip() - try await perform_testFail( endpoint: .resetPasswordPollCompletion, response: .unauthorizedClient, @@ -113,16 +111,6 @@ final class MSALNativeAuthResetPasswordPollCompletionIntegrationTests: MSALNativ ) } - func test_resetPasswordPollCompletion_invalidContinuationToken() async throws { - throw XCTSkip() - - try await perform_testFail( - endpoint: .resetPasswordPollCompletion, - response: .invalidContinuationToken, - expectedError: createResetPasswordPollCompletionError(error: .invalidRequest) - ) - } - func test_resetPasswordPollCompletion_expiredToken() async throws { try await perform_testFail( endpoint: .resetPasswordPollCompletion, diff --git a/MSAL/test/integration/native_auth/requests/reset_password/MSALNativeAuthResetPasswordStartIntegrationTests.swift b/MSAL/test/integration/native_auth/requests/reset_password/MSALNativeAuthResetPasswordStartIntegrationTests.swift index 8515b5fd0c..187b42de33 100644 --- a/MSAL/test/integration/native_auth/requests/reset_password/MSALNativeAuthResetPasswordStartIntegrationTests.swift +++ b/MSAL/test/integration/native_auth/requests/reset_password/MSALNativeAuthResetPasswordStartIntegrationTests.swift @@ -69,9 +69,7 @@ final class MSALNativeAuthResetPasswordStartIntegrationTests: MSALNativeAuthInte XCTAssertEqual(response?.challengeType, .redirect) } - func test_resetPasswordStart_unauthorizedClient() async throws { - throw XCTSkip() - + func test_resetPasswordStart_unauthorizedClient() async throws { try await perform_testFail( endpoint: .resetPasswordStart, response: .unauthorizedClient, diff --git a/MSAL/test/integration/native_auth/requests/reset_password/MSALNativeAuthResetPasswordSubmitIntegrationTests.swift b/MSAL/test/integration/native_auth/requests/reset_password/MSALNativeAuthResetPasswordSubmitIntegrationTests.swift index e57f57ebee..a27d2c06f7 100644 --- a/MSAL/test/integration/native_auth/requests/reset_password/MSALNativeAuthResetPasswordSubmitIntegrationTests.swift +++ b/MSAL/test/integration/native_auth/requests/reset_password/MSALNativeAuthResetPasswordSubmitIntegrationTests.swift @@ -61,8 +61,6 @@ final class MSALNativeAuthResetPasswordSubmitIntegrationTests: MSALNativeAuthInt } func test_resetPasswordSubmit_unauthorizedClient() async throws { - throw XCTSkip() - try await perform_testFail( endpoint: .resetPasswordSubmit, response: .unauthorizedClient, @@ -70,16 +68,6 @@ final class MSALNativeAuthResetPasswordSubmitIntegrationTests: MSALNativeAuthInt ) } - func test_resetPasswordSubmit_invalidContinuationToken() async throws { - throw XCTSkip() - - try await perform_testFail( - endpoint: .resetPasswordSubmit, - response: .invalidContinuationToken, - expectedError: createError(.invalidRequest) - ) - } - func test_resetPasswordSubmit_expiredToken() async throws { try await perform_testFail( endpoint: .resetPasswordSubmit, diff --git a/MSAL/test/integration/native_auth/requests/sign_in/MSALNativeAuthSignInChallengeIntegrationTests.swift b/MSAL/test/integration/native_auth/requests/sign_in/MSALNativeAuthSignInChallengeIntegrationTests.swift index 071b1c4c65..23bab460ce 100644 --- a/MSAL/test/integration/native_auth/requests/sign_in/MSALNativeAuthSignInChallengeIntegrationTests.swift +++ b/MSAL/test/integration/native_auth/requests/sign_in/MSALNativeAuthSignInChallengeIntegrationTests.swift @@ -76,8 +76,6 @@ class MSALNativeAuthSignInChallengeIntegrationTests: MSALNativeAuthIntegrationBa func test_failRequest_unauthorizedClient() async throws { - throw XCTSkip() - try await perform_testFail( endpoint: .signInChallenge, response: .unauthorizedClient, @@ -85,21 +83,12 @@ class MSALNativeAuthSignInChallengeIntegrationTests: MSALNativeAuthIntegrationBa ) } - func test_failRequest_invalidPurposeToken() async throws { - throw XCTSkip() - - let response = try await perform_testFail( + func test_failRequest_invalidContinuationToken() async throws { + try await perform_testFail( endpoint: .signInChallenge, - response: .invalidPurposeToken, - expectedError: Error(error: .invalidRequest, errorDescription: nil, errorCodes: nil, errorURI: nil, innerErrors: nil) + response: .invalidContinuationToken, + expectedError: Error(error: .invalidRequest, errorDescription: nil, errorCodes: [55000], errorURI: nil, innerErrors: nil) ) - - guard let innerError = response.innerErrors?.first else { - return XCTFail("There should be an inner error") - } - - XCTAssertEqual(innerError.error, "invalid_purpose_token") - XCTAssertNotNil(innerError.errorDescription) } func test_failRequest_expiredToken() async throws { diff --git a/MSAL/test/integration/native_auth/requests/sign_in/MSALNativeAuthSignInInitiateIntegrationTests.swift b/MSAL/test/integration/native_auth/requests/sign_in/MSALNativeAuthSignInInitiateIntegrationTests.swift index bdfcac292d..1f0477d01b 100644 --- a/MSAL/test/integration/native_auth/requests/sign_in/MSALNativeAuthSignInInitiateIntegrationTests.swift +++ b/MSAL/test/integration/native_auth/requests/sign_in/MSALNativeAuthSignInInitiateIntegrationTests.swift @@ -64,9 +64,7 @@ class MSALNativeAuthSignInInitiateIntegrationTests: MSALNativeAuthIntegrationBas XCTAssertEqual(response?.challengeType, .redirect) } - func test_failRequest_unauthorizedClient() async throws { - throw XCTSkip() - + func test_failRequest_unauthorizedClient() async throws { try await perform_testFail( endpoint: .signInInitiate, response: .unauthorizedClient, diff --git a/MSAL/test/integration/native_auth/requests/sign_up/MSALNativeAuthSignUpChallengeIntegrationTests.swift b/MSAL/test/integration/native_auth/requests/sign_up/MSALNativeAuthSignUpChallengeIntegrationTests.swift index fbec1cd4e1..c2fa601af3 100644 --- a/MSAL/test/integration/native_auth/requests/sign_up/MSALNativeAuthSignUpChallengeIntegrationTests.swift +++ b/MSAL/test/integration/native_auth/requests/sign_up/MSALNativeAuthSignUpChallengeIntegrationTests.swift @@ -73,8 +73,6 @@ final class MSALNativeAuthSignUpChallengeIntegrationTests: MSALNativeAuthIntegra } func test_signUpChallenge_unauthorizedClient() async throws { - throw XCTSkip() - try await perform_testFail( endpoint: .signUpChallenge, response: .unauthorizedClient, @@ -98,16 +96,6 @@ final class MSALNativeAuthSignUpChallengeIntegrationTests: MSALNativeAuthIntegra ) } - func test_signUpChallenge_invalidContinuationToken() async throws { - throw XCTSkip() - - try await perform_testFail( - endpoint: .signUpChallenge, - response: .invalidContinuationToken, - expectedError: createError(.invalidRequest) - ) - } - private func createError(_ error: MSALNativeAuthSignUpChallengeOauth2ErrorCode) -> MSALNativeAuthSignUpChallengeResponseError { .init(error: error, errorDescription: nil, errorCodes: nil, errorURI: nil, innerErrors: nil) } diff --git a/MSAL/test/integration/native_auth/requests/sign_up/MSALNativeAuthSignUpContinueIntegrationTests.swift b/MSAL/test/integration/native_auth/requests/sign_up/MSALNativeAuthSignUpContinueIntegrationTests.swift index 0b2cb0d26f..6849e05da4 100644 --- a/MSAL/test/integration/native_auth/requests/sign_up/MSALNativeAuthSignUpContinueIntegrationTests.swift +++ b/MSAL/test/integration/native_auth/requests/sign_up/MSALNativeAuthSignUpContinueIntegrationTests.swift @@ -85,8 +85,6 @@ final class MSALNativeAuthSignUpContinueIntegrationTests: MSALNativeAuthIntegrat } func test_signUpContinue_unauthorizedClient() async throws { - throw XCTSkip() - try await perform_testFail( endpoint: .signUpContinue, response: .unauthorizedClient, @@ -102,16 +100,6 @@ final class MSALNativeAuthSignUpContinueIntegrationTests: MSALNativeAuthIntegrat ) } - func test_signUpContinue_invalidContinuationToken() async throws { - throw XCTSkip() - - try await perform_testFail( - endpoint: .signUpContinue, - response: .invalidContinuationToken, - expectedError: createError(.invalidRequest) - ) - } - func test_signUpContinue_expiredToken() async throws { try await perform_testFail( endpoint: .signUpContinue, @@ -198,15 +186,13 @@ final class MSALNativeAuthSignUpContinueIntegrationTests: MSALNativeAuthIntegrat } func test_signUpContinue_validationFailed() async throws { - throw XCTSkip() - let response = try await perform_testFail( endpoint: .signUpContinue, response: .attributeValidationFailed, expectedError: createError(.invalidGrant, subError: .attributeValidationFailed) ) - XCTAssertNotNil(response.continuationToken) + XCTAssertNil(response.continuationToken) XCTAssertNotNil(response.invalidAttributes) } diff --git a/MSAL/test/integration/native_auth/requests/sign_up/MSALNativeAuthSignUpStartIntegrationTests.swift b/MSAL/test/integration/native_auth/requests/sign_up/MSALNativeAuthSignUpStartIntegrationTests.swift index 912c5415df..ab2ef8cc3d 100644 --- a/MSAL/test/integration/native_auth/requests/sign_up/MSALNativeAuthSignUpStartIntegrationTests.swift +++ b/MSAL/test/integration/native_auth/requests/sign_up/MSALNativeAuthSignUpStartIntegrationTests.swift @@ -63,9 +63,7 @@ final class MSALNativeAuthSignUpStartIntegrationTests: MSALNativeAuthIntegration XCTAssertEqual(response?.challengeType, .redirect) } - func test_signUpStart_unauthorizedClient() async throws { - throw XCTSkip() - + func test_signUpStart_unauthorizedClient() async throws { try await perform_testFail( endpoint: .signUpStart, response: .unauthorizedClient, diff --git a/MSAL/test/integration/native_auth/requests/token/MSALNativeAuthTokenIntegrationTests.swift b/MSAL/test/integration/native_auth/requests/token/MSALNativeAuthTokenIntegrationTests.swift index 6c72140241..80b48bbdfd 100644 --- a/MSAL/test/integration/native_auth/requests/token/MSALNativeAuthTokenIntegrationTests.swift +++ b/MSAL/test/integration/native_auth/requests/token/MSALNativeAuthTokenIntegrationTests.swift @@ -99,21 +99,12 @@ class MSALNativeAuthTokenIntegrationTests: MSALNativeAuthIntegrationBaseTests { await fulfillment(of: [expectation], timeout: defaultTimeout) } - func test_failRequest_invalidPurposeToken() async throws { - throw XCTSkip() - - let response = try await perform_testFail( + func test_failRequest_invalidContinuationToken() async throws { + try await perform_testFail( endpoint: .signInToken, - response: .invalidPurposeToken, - expectedError: createError(.invalidRequest) + response: .invalidContinuationToken, + expectedError: Error(error: .invalidRequest, errorDescription: nil, errorCodes: [55000], errorURI: nil, innerErrors: nil) ) - - guard let innerError = response.innerErrors?.first else { - return XCTFail("There should be an inner error") - } - - XCTAssertEqual(innerError.error, "invalid_purpose_token") - XCTAssertNotNil(innerError.errorDescription) } func test_failRequest_invalidPassword() async throws { @@ -170,7 +161,7 @@ class MSALNativeAuthTokenIntegrationTests: MSALNativeAuthIntegrationBaseTests { let expectedError = createError(.slowDown) - XCTAssertEqual(result.error?.rawValue, expectedError.error?.rawValue) + XCTAssertEqual(result.error.rawValue, expectedError.error.rawValue) } private func createError(_ code: MSALNativeAuthTokenOauth2ErrorCode, subError: MSALNativeAuthSubErrorCode? = nil, errorCodes: [MSALNativeAuthESTSApiErrorCodes]? = nil) -> Error {