Skip to content

Commit

Permalink
mock read permission
Browse files Browse the repository at this point in the history
  • Loading branch information
calypsomatic committed Mar 22, 2024
1 parent a162678 commit b22a4ba
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ object States {
val UserExists = "user exists"
val HasResourceDeletePermission = "user has delete permission"
val HasResourceWritePermission = "user has write permission"
val HasResourceReadPermission = "user had read permission"
val DoesNotHaveResourceDeletePermission = "user does not have delete permission"
val DoesNotHaveResourceWritePermission = "user does not have write permission"
val DoesNotHaveResourceReadPermission = "user does not have read permission"
val UserStatusInfoRequestWithAccessToken = "user status info request with access token"
val UserStatusInfoRequestWithoutAccessToken = "user status info request without access token"
}
Expand Down Expand Up @@ -162,10 +164,14 @@ class SamProviderSpec
mockResourceActionPermission(SamResourceActions.delete, hasPermission = true).unsafeRunSync()
case ProviderState(States.HasResourceWritePermission, _) =>
mockResourceActionPermission(SamResourceActions.write, hasPermission = true).unsafeRunSync()
case ProviderState(States.HasResourceReadPermission, _) =>
mockResourceActionPermission(SamResourceActions.read, hasPermission = true).unsafeRunSync()
case ProviderState(States.DoesNotHaveResourceDeletePermission, _) =>
mockResourceActionPermission(SamResourceActions.delete, hasPermission = false).unsafeRunSync()
case ProviderState(States.DoesNotHaveResourceWritePermission, _) =>
mockResourceActionPermission(SamResourceActions.write, hasPermission = false).unsafeRunSync()
case ProviderState(States.DoesNotHaveResourceReadPermission, _) =>
mockResourceActionPermission(SamResourceActions.read, hasPermission = false).unsafeRunSync()
case ProviderState(States.UserStatusInfoRequestWithAccessToken, _) =>
logger.debug(s"you may stub provider behaviors here for the state: ${States.UserStatusInfoRequestWithAccessToken}")
case ProviderState(States.UserStatusInfoRequestWithoutAccessToken, _) =>
Expand Down

0 comments on commit b22a4ba

Please sign in to comment.