@@ -41,7 +41,7 @@ public async Task HandleRequirementAsync_TC01Async()
4141 AuthorizationHandlerContext context = CreateAuthorizationHandlerContext ( ) ;
4242 _httpContextAccessorMock . Setup ( h => h . HttpContext ) . Returns ( CreateHttpContext ( ) ) ;
4343 XacmlJsonResponse response = CreateResponse ( XacmlContextDecision . Permit . ToString ( ) ) ;
44- _pdpMock . Setup ( a => a . GetDecisionForRequest ( It . IsAny < XacmlJsonRequestRoot > ( ) ) ) . Returns ( Task . FromResult ( response ) ) ;
44+ _pdpMock . Setup ( a => a . GetDecisionForRequest ( It . IsAny < XacmlJsonRequestRoot > ( ) , It . IsAny < CancellationToken > ( ) ) ) . Returns ( Task . FromResult ( response ) ) ;
4545
4646 // Act
4747 await _aah . HandleAsync ( context ) ;
@@ -62,7 +62,7 @@ public async Task HandleRequirementAsync_TC02Async()
6262 AuthorizationHandlerContext context = CreateAuthorizationHandlerContext ( ) ;
6363 _httpContextAccessorMock . Setup ( h => h . HttpContext ) . Returns ( CreateHttpContext ( ) ) ;
6464 XacmlJsonResponse response = CreateResponse ( XacmlContextDecision . Deny . ToString ( ) ) ;
65- _pdpMock . Setup ( a => a . GetDecisionForRequest ( It . IsAny < XacmlJsonRequestRoot > ( ) ) ) . Returns ( Task . FromResult ( response ) ) ;
65+ _pdpMock . Setup ( a => a . GetDecisionForRequest ( It . IsAny < XacmlJsonRequestRoot > ( ) , It . IsAny < CancellationToken > ( ) ) ) . Returns ( Task . FromResult ( response ) ) ;
6666
6767 // Act
6868 await _aah . HandleAsync ( context ) ;
@@ -86,7 +86,7 @@ public async Task HandleRequirementAsync_TC03Async()
8686
8787 // Add extra result
8888 response . Response . Add ( new XacmlJsonResult ( ) ) ;
89- _pdpMock . Setup ( a => a . GetDecisionForRequest ( It . IsAny < XacmlJsonRequestRoot > ( ) ) ) . Returns ( Task . FromResult ( response ) ) ;
89+ _pdpMock . Setup ( a => a . GetDecisionForRequest ( It . IsAny < XacmlJsonRequestRoot > ( ) , It . IsAny < CancellationToken > ( ) ) ) . Returns ( Task . FromResult ( response ) ) ;
9090
9191 // Act
9292 await _aah . HandleAsync ( context ) ;
@@ -108,7 +108,7 @@ public async Task HandleRequirementAsync_TC04Async()
108108 _httpContextAccessorMock . Setup ( h => h . HttpContext ) . Returns ( CreateHttpContext ( ) ) ;
109109 XacmlJsonResponse response = CreateResponse ( XacmlContextDecision . Permit . ToString ( ) ) ;
110110 AddObligationWithMinAuthLv ( response , "2" ) ;
111- _pdpMock . Setup ( a => a . GetDecisionForRequest ( It . IsAny < XacmlJsonRequestRoot > ( ) ) ) . Returns ( Task . FromResult ( response ) ) ;
111+ _pdpMock . Setup ( a => a . GetDecisionForRequest ( It . IsAny < XacmlJsonRequestRoot > ( ) , It . IsAny < CancellationToken > ( ) ) ) . Returns ( Task . FromResult ( response ) ) ;
112112
113113 // Act
114114 await _aah . HandleAsync ( context ) ;
@@ -130,7 +130,7 @@ public async Task HandleRequirementAsync_TC05Async()
130130 _httpContextAccessorMock . Setup ( h => h . HttpContext ) . Returns ( CreateHttpContext ( ) ) ;
131131 XacmlJsonResponse response = CreateResponse ( XacmlContextDecision . Permit . ToString ( ) ) ;
132132 AddObligationWithMinAuthLv ( response , "3" ) ;
133- _pdpMock . Setup ( a => a . GetDecisionForRequest ( It . IsAny < XacmlJsonRequestRoot > ( ) ) ) . Returns ( Task . FromResult ( response ) ) ;
133+ _pdpMock . Setup ( a => a . GetDecisionForRequest ( It . IsAny < XacmlJsonRequestRoot > ( ) , It . IsAny < CancellationToken > ( ) ) ) . Returns ( Task . FromResult ( response ) ) ;
134134
135135 // Act
136136 await _aah . HandleAsync ( context ) ;
@@ -151,7 +151,7 @@ public async Task HandleRequirementAsync_TC06Async()
151151 AuthorizationHandlerContext context = CreateAuthorizationHandlerContext ( ) ;
152152 _httpContextAccessorMock . Setup ( h => h . HttpContext ) . Returns ( CreateHttpContext ( ) ) ;
153153 XacmlJsonResponse response = null ;
154- _pdpMock . Setup ( a => a . GetDecisionForRequest ( It . IsAny < XacmlJsonRequestRoot > ( ) ) ) . Returns ( Task . FromResult ( response ) ) ;
154+ _pdpMock . Setup ( a => a . GetDecisionForRequest ( It . IsAny < XacmlJsonRequestRoot > ( ) , It . IsAny < CancellationToken > ( ) ) ) . Returns ( Task . FromResult ( response ) ) ;
155155
156156 // Act & Assert
157157 await Assert . ThrowsAsync < ArgumentNullException > ( ( ) => _aah . HandleAsync ( context ) ) ;
@@ -171,7 +171,7 @@ public async Task HandleRequirementAsync_TC07Async()
171171 // Create response with a result list that is null
172172 XacmlJsonResponse response = new XacmlJsonResponse ( ) ;
173173 response . Response = null ;
174- _pdpMock . Setup ( a => a . GetDecisionForRequest ( It . IsAny < XacmlJsonRequestRoot > ( ) ) ) . Returns ( Task . FromResult ( response ) ) ;
174+ _pdpMock . Setup ( a => a . GetDecisionForRequest ( It . IsAny < XacmlJsonRequestRoot > ( ) , It . IsAny < CancellationToken > ( ) ) ) . Returns ( Task . FromResult ( response ) ) ;
175175
176176 // Act & Assert
177177 await Assert . ThrowsAsync < ArgumentNullException > ( ( ) => _aah . HandleAsync ( context ) ) ;
@@ -192,7 +192,7 @@ public async Task HandleRequirementAsync_TC08Async()
192192 AddObligationWithMinAuthLv ( response , "2" ) ;
193193
194194 // verify
195- _pdpMock . Setup ( a => a . GetDecisionForRequest ( It . IsAny < XacmlJsonRequestRoot > ( ) ) ) . Returns ( Task . FromResult ( response ) ) ;
195+ _pdpMock . Setup ( a => a . GetDecisionForRequest ( It . IsAny < XacmlJsonRequestRoot > ( ) , It . IsAny < CancellationToken > ( ) ) ) . Returns ( Task . FromResult ( response ) ) ;
196196
197197 // Act
198198 await _aah . HandleAsync ( context ) ;
@@ -209,7 +209,7 @@ public async Task HandleRequirementAsync_TC09Async()
209209 AuthorizationHandlerContext context = CreateAuthorizationHandlerContextSystemUser ( ) ;
210210 _httpContextAccessorMock . Setup ( h => h . HttpContext ) . Returns ( CreateHttpContext ( ) ) ;
211211 XacmlJsonResponse response = CreateResponse ( XacmlContextDecision . Permit . ToString ( ) ) ;
212- _pdpMock . Setup ( a => a . GetDecisionForRequest ( It . IsAny < XacmlJsonRequestRoot > ( ) ) ) . Returns ( Task . FromResult ( response ) ) ;
212+ _pdpMock . Setup ( a => a . GetDecisionForRequest ( It . IsAny < XacmlJsonRequestRoot > ( ) , It . IsAny < CancellationToken > ( ) ) ) . Returns ( Task . FromResult ( response ) ) ;
213213
214214 // Act
215215 await _aah . HandleAsync ( context ) ;
@@ -230,7 +230,7 @@ public async Task HandleRequirementAsync_TC10Async()
230230 AuthorizationHandlerContext context = CreateAuthorizationHandlerContextAppUser ( "app_skd_flyttemelding" ) ;
231231 _httpContextAccessorMock . Setup ( h => h . HttpContext ) . Returns ( CreateHttpContext ( ) ) ;
232232 XacmlJsonResponse response = CreateResponse ( XacmlContextDecision . Permit . ToString ( ) ) ;
233- _pdpMock . Setup ( a => a . GetDecisionForRequest ( It . IsAny < XacmlJsonRequestRoot > ( ) ) ) . Returns ( Task . FromResult ( response ) ) ;
233+ _pdpMock . Setup ( a => a . GetDecisionForRequest ( It . IsAny < XacmlJsonRequestRoot > ( ) , It . IsAny < CancellationToken > ( ) ) ) . Returns ( Task . FromResult ( response ) ) ;
234234
235235 // Act
236236 await _aah . HandleAsync ( context ) ;
0 commit comments