Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AJ-1570 mock read permission #1385

Merged
merged 3 commits into from
Mar 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading