From b22a4ba37cb4b7b554b0ddc57b3d2ea1ac736189 Mon Sep 17 00:00:00 2001 From: Bria Morgan Date: Fri, 22 Mar 2024 14:19:41 -0400 Subject: [PATCH] mock read permission --- .../dsde/workbench/sam/provider/SamProviderSpec.scala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/sam/provider/SamProviderSpec.scala b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/sam/provider/SamProviderSpec.scala index e30a0708d..6dce16bf1 100644 --- a/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/sam/provider/SamProviderSpec.scala +++ b/pact4s/src/test/scala/org/broadinstitute/dsde/workbench/sam/provider/SamProviderSpec.scala @@ -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" } @@ -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, _) =>