Skip to content

Commit 28f3eae

Browse files
author
Swasti Gupta
committed
Fix failing unit tests Acquire Token
1 parent 1908777 commit 28f3eae

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

MSAL/test/unit/MSALAcquireTokenTests.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ - (void)testAcquireTokenInteractive_whenClaimsIsPassedViaOverloadedAcquireToken_
701701
XCTestExpectation *expectation = [self expectationWithDescription:@"acquireToken"];
702702

703703
MSALWebviewParameters *webviewParameters = [[MSALWebviewParameters alloc] initWithAuthPresentationViewController:[self.class sharedViewControllerStub]];
704-
__auto_type parameters = [[MSALInteractiveTokenParameters alloc] initWithScopes:@[@"fakeb2cscopes"]
704+
__auto_type parameters = [[MSALInteractiveTokenParameters alloc] initWithScopes:@[@"fakescopes"]
705705
webviewParameters:webviewParameters];
706706
parameters.promptType = MSALPromptTypeDefault;
707707
parameters.extraQueryParameters = @{@"eqpKey":@"eqpValue"};
@@ -914,7 +914,7 @@ - (void)testAcquireTokenInteractive_whenMultipleCloudsSetToYes_shouldSendInstanc
914914
XCTestExpectation *expectation = [self expectationWithDescription:@"acquireToken"];
915915

916916
MSALWebviewParameters *webviewParameters = [[MSALWebviewParameters alloc] initWithAuthPresentationViewController:[self.class sharedViewControllerStub]];
917-
__auto_type parameters = [[MSALInteractiveTokenParameters alloc] initWithScopes:@[@"fakeb2cscopes"]
917+
__auto_type parameters = [[MSALInteractiveTokenParameters alloc] initWithScopes:@[@"fakescopes"]
918918
webviewParameters:webviewParameters];
919919
parameters.promptType = MSALPromptTypeDefault;
920920
parameters.webviewParameters.webviewType = MSALWebviewTypeWKWebView;
@@ -1013,7 +1013,7 @@ - (void)testAcquireTokenInteractive_whenCapabilitiesSet_shouldSendCapabilitiesTo
10131013
XCTestExpectation *expectation = [self expectationWithDescription:@"acquireToken"];
10141014

10151015
MSALWebviewParameters *webviewParameters = [[MSALWebviewParameters alloc] initWithAuthPresentationViewController:[self.class sharedViewControllerStub]];
1016-
__auto_type parameters = [[MSALInteractiveTokenParameters alloc] initWithScopes:@[@"fakeb2cscopes"]
1016+
__auto_type parameters = [[MSALInteractiveTokenParameters alloc] initWithScopes:@[@"fakescopes"]
10171017
webviewParameters:webviewParameters];
10181018
parameters.promptType = MSALPromptTypeDefault;
10191019
parameters.extraQueryParameters = @{@"eqpKey":@"eqpValue"};
@@ -1115,7 +1115,7 @@ - (void)testAcquireTokenInteractive_whenClaimsIsPassedAndCapabilitiesSet_shouldS
11151115
XCTestExpectation *expectation = [self expectationWithDescription:@"acquireToken"];
11161116

11171117
MSALWebviewParameters *webviewParameters = [[MSALWebviewParameters alloc] initWithAuthPresentationViewController:[self.class sharedViewControllerStub]];
1118-
__auto_type parameters = [[MSALInteractiveTokenParameters alloc] initWithScopes:@[@"fakeb2cscopes"]
1118+
__auto_type parameters = [[MSALInteractiveTokenParameters alloc] initWithScopes:@[@"fakescopes"]
11191119
webviewParameters:webviewParameters];
11201120
parameters.webviewParameters.webviewType = MSALWebviewTypeWKWebView;
11211121
parameters.promptType = MSALPromptTypeDefault;
@@ -1218,7 +1218,7 @@ - (void)testAcquireTokenInteractive_whenClaimsIsPassedAndLoginHintNotNil_shouldS
12181218
XCTestExpectation *expectation = [self expectationWithDescription:@"acquireToken"];
12191219

12201220
MSALWebviewParameters *webviewParameters = [[MSALWebviewParameters alloc] initWithAuthPresentationViewController:[self.class sharedViewControllerStub]];
1221-
__auto_type parameters = [[MSALInteractiveTokenParameters alloc] initWithScopes:@[@"fakeb2cscopes"]
1221+
__auto_type parameters = [[MSALInteractiveTokenParameters alloc] initWithScopes:@[@"fakescopes"]
12221222
webviewParameters:webviewParameters];
12231223
parameters.webviewParameters.webviewType = MSALWebviewTypeWKWebView;
12241224
parameters.loginHint = @"[email protected]";
@@ -1327,7 +1327,7 @@ - (void)testAcquireTokenInteractive_whenInstanceAware_shouldReturnCloudAuthority
13271327
__block MSALResult *result = nil;
13281328

13291329
MSALWebviewParameters *webviewParameters = [[MSALWebviewParameters alloc] initWithAuthPresentationViewController:[self.class sharedViewControllerStub]];
1330-
__auto_type parameters = [[MSALInteractiveTokenParameters alloc] initWithScopes:@[@"fakeb2cscopes"]
1330+
__auto_type parameters = [[MSALInteractiveTokenParameters alloc] initWithScopes:@[@"fakescopes"]
13311331
webviewParameters:webviewParameters];
13321332
parameters.webviewParameters.webviewType = MSALWebviewTypeWKWebView;
13331333
parameters.promptType = MSALPromptTypeDefault;
@@ -1817,7 +1817,7 @@ - (void)testAcquireTokenInteractive_whenInsufficientScopesReturned_shouldReturnN
18171817
__block MSALResult *result = nil;
18181818

18191819
MSALWebviewParameters *webviewParameters = [[MSALWebviewParameters alloc] initWithAuthPresentationViewController:[self.class sharedViewControllerStub]];
1820-
__auto_type parameters = [[MSALInteractiveTokenParameters alloc] initWithScopes:@[@"fakeb2cscopes"]
1820+
__auto_type parameters = [[MSALInteractiveTokenParameters alloc] initWithScopes:@[@"fakescope3", @"fakescope4", @"fakescope1"]
18211821
webviewParameters:webviewParameters];
18221822
parameters.webviewParameters.webviewType = MSALWebviewTypeWKWebView;
18231823
parameters.promptType = MSALPromptTypeDefault;
@@ -2963,7 +2963,7 @@ - (void)testAcquireTokenInteractive_whenAccountMismatch_shouldReturnAccountMisma
29632963
tenantProfiles:nil];
29642964

29652965
MSALWebviewParameters *webviewParameters = [[MSALWebviewParameters alloc] initWithAuthPresentationViewController:[self.class sharedViewControllerStub]];
2966-
__auto_type parameters = [[MSALInteractiveTokenParameters alloc] initWithScopes:@[@"fakeb2cscopes"]
2966+
__auto_type parameters = [[MSALInteractiveTokenParameters alloc] initWithScopes:@[@"fakescope"]
29672967
webviewParameters:webviewParameters];
29682968
parameters.webviewParameters.webviewType = MSALWebviewTypeWKWebView;
29692969
parameters.promptType = MSALPromptTypeDefault;

MSAL/test/unit/MSALPublicClientApplicationTests.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1892,7 +1892,7 @@ - (void)testAcquireSilentScopesUser_whenNoAuthority_andNonCommonAuthorityInPubli
18921892
MSIDRequestParameters *params = [obj requestParameters];
18931893
XCTAssertNotNil(params);
18941894

1895-
NSString *expectedApiId = [NSString stringWithFormat:@"%ld", (long)MSALTelemetryApiIdAcquireSilentWithUser];
1895+
NSString *expectedApiId = [NSString stringWithFormat:@"%ld", (long)MSALTelemetryApiIdAcquireSilentWithTokenParameters];
18961896
XCTAssertEqualObjects(params.telemetryApiId, expectedApiId);
18971897
XCTAssertEqualObjects(params.accountIdentifier.displayableId, @"[email protected]");
18981898
XCTAssertEqualObjects(params.accountIdentifier.homeAccountId, @"1.1234-5678-90abcdefg");
@@ -1953,7 +1953,7 @@ - (void)testAcquireSilentScopesUser_whenNilAuthority_andNonCommonAuthorityInPubl
19531953
MSIDRequestParameters *params = [obj requestParameters];
19541954
XCTAssertNotNil(params);
19551955

1956-
NSString *expectedApiId = [NSString stringWithFormat:@"%ld", (long)MSALTelemetryApiIdAcquireSilentWithUserAndAuthority];
1956+
NSString *expectedApiId = [NSString stringWithFormat:@"%ld", (long)MSALTelemetryApiIdAcquireSilentWithTokenParameters];
19571957
XCTAssertEqualObjects(params.telemetryApiId, expectedApiId);
19581958
XCTAssertEqualObjects(params.accountIdentifier.displayableId, @"[email protected]");
19591959
XCTAssertEqualObjects(params.accountIdentifier.homeAccountId, @"1.1234-5678-90abcdefg");

0 commit comments

Comments
 (0)