@@ -162,7 +162,7 @@ - (void)testCheckAuthority_whenAuthorityInvalid_shouldReturnError
162
162
requestParams.authority = authority;
163
163
requestParams.correlationId = [NSUUID UUID ];
164
164
165
- [ADTestURLSession addResponse: [ADTestAuthorityValidationResponse invalidAuthority: authority]];
165
+ [ADTestURLSession addResponse: [ADTestAuthorityValidationResponse invalidAuthority: authority validationEnabled: YES ]];
166
166
167
167
XCTestExpectation* expectation = [self expectationWithDescription: @" Validate invalid authority." ];
168
168
[authorityValidation checkAuthority: requestParams
@@ -194,7 +194,7 @@ - (void)testCheckAuthority_whenAuthorityInvalidAndNoValidation_shouldReturnNoErr
194
194
requestParams.authority = authority;
195
195
requestParams.correlationId = [NSUUID UUID ];
196
196
197
- [ADTestURLSession addResponse: [ADTestAuthorityValidationResponse invalidAuthority: authority]];
197
+ [ADTestURLSession addResponse: [ADTestAuthorityValidationResponse invalidAuthority: authority validationEnabled: NO ]];
198
198
199
199
XCTestExpectation* expectation = [self expectationWithDescription: @" Validate invalid authority." ];
200
200
[authorityValidation checkAuthority: requestParams
@@ -228,7 +228,7 @@ - (void)testAcquireToken_whenAuthorityInvalid_shouldReturnError
228
228
XCTAssertNotNil (context);
229
229
XCTAssertNil (error);
230
230
231
- [ADTestURLSession addResponse: [ADTestAuthorityValidationResponse invalidAuthority: authority]];
231
+ [ADTestURLSession addResponse: [ADTestAuthorityValidationResponse invalidAuthority: authority validationEnabled: YES ]];
232
232
233
233
XCTestExpectation* expectation = [self expectationWithDescription: @" acquireTokenWithResource: with invalid authority." ];
234
234
[context acquireTokenWithResource: TEST_RESOURCE
@@ -284,7 +284,7 @@ - (void)testAcquireToken_whenAuthorityInvalidWithAuthorityValidationOff_shouldGe
284
284
newAccessToken: updatedAT
285
285
newIDToken: [self adDefaultIDToken ]
286
286
additionalFields: @{ @" foci" : @" 1" }];
287
- [ADTestURLSession addResponses: @[[ADTestAuthorityValidationResponse invalidAuthority: authority],
287
+ [ADTestURLSession addResponses: @[[ADTestAuthorityValidationResponse invalidAuthority: authority validationEnabled: NO ],
288
288
tokenResponse ]];
289
289
290
290
__block XCTestExpectation *expectation = [self expectationWithDescription: @" acquire token" ];
@@ -510,7 +510,7 @@ - (void)testAcquireTokenSilent_whenDifferentPreferredNetworkValidateOff_shouldUs
510
510
NSArray *metadata = @[ @{ @" preferred_network" : @" login.contoso.net" ,
511
511
@" preferred_cache" : @" login.contoso.com" ,
512
512
@" aliases" : @[ @" login.contoso.net" , @" login.contoso.com" ] } ];
513
- ADTestURLResponse *validationResponse = [ADTestAuthorityValidationResponse validAuthority: authority withMetadata: metadata];
513
+ ADTestURLResponse *validationResponse = [ADTestAuthorityValidationResponse validAuthority: authority trustedHost: @" login.contoso.com " withMetadata: metadata];
514
514
ADTestURLResponse *tokenResponse = [self adResponseRefreshToken: TEST_REFRESH_TOKEN
515
515
authority: preferredAuthority
516
516
resource: TEST_RESOURCE
0 commit comments