-
Hi I am looking to write unit tests for specific routes that have RouteClaimsRequirement. I am struggling to find the services to mock in order to avoid calling the end services while still being able to mock the claims logic. Apologies if I am missing the solution to this issue on the docs. Thanks! :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I believe you need to mock injected services of the ClaimsAuthorizer class 👇 Ocelot/src/Ocelot/Authorization/ClaimsAuthorizer.cs Lines 10 to 15 in 6e9a975 So, you have to mock Anything else? |
Beta Was this translation helpful? Give feedback.
I believe you need to mock injected services of the ClaimsAuthorizer class 👇
Ocelot/src/Ocelot/Authorization/ClaimsAuthorizer.cs
Lines 10 to 15 in 6e9a975
So, you have to mock
IClaimsParser
interface object, and/orIClaimsAuthorizer
object.But exact mocking depends on the unit test and testing scenario.
Anything else?