Skip to content

Commit

Permalink
fix GoogleExtensionSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghost-in-a-Jar committed Jul 15, 2024
1 parent de9bcb1 commit df10db6
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,12 @@ class GoogleExtensionSpec(_system: ActorSystem)
when(mockDirectoryDAO.getSynchronizedDate(any[FullyQualifiedPolicyId], any[SamRequestContext]))
.thenReturn(IO.pure(Some(new GregorianCalendar(2018, 8, 26).getTime())))
when(mockGoogleGroupSyncPubSubDAO.publishMessages(any[String], any[Seq[MessageRequest]])).thenReturn(Future.successful(()))
when(
mockDirectoryDAO.updateGroupUpdatedDateAndVersionWithSession(
any[WorkbenchGroupIdentity],
any[SamRequestContext]
)
).thenReturn(IO.unit)

// mock responses for onManagedGroupUpdate
when(mockAccessPolicyDAO.listSyncedAccessPolicyIdsOnResourcesConstrainedByGroup(WorkbenchGroupName(managedGroupId), Set.empty, samRequestContext))
Expand Down Expand Up @@ -1130,6 +1136,12 @@ class GoogleExtensionSpec(_system: ActorSystem)
when(mockDirectoryDAO.getSynchronizedDate(any[FullyQualifiedPolicyId], any[SamRequestContext]))
.thenReturn(IO.pure(Some(new GregorianCalendar(2018, 8, 26).getTime())))
when(mockGoogleGroupSyncPubSubDAO.publishMessages(any[String], any[Seq[MessageRequest]])).thenReturn(Future.successful(()))
when(
mockDirectoryDAO.updateGroupUpdatedDateAndVersionWithSession(
any[WorkbenchGroupIdentity],
any[SamRequestContext]
)
).thenReturn(IO.unit)

// mock ancestor call to establish subgroup relationship to managed group
when(mockDirectoryDAO.listAncestorGroups(WorkbenchGroupName(subGroupId), samRequestContext))
Expand Down Expand Up @@ -1184,6 +1196,12 @@ class GoogleExtensionSpec(_system: ActorSystem)
when(mockDirectoryDAO.getSynchronizedDate(any[FullyQualifiedPolicyId], any[SamRequestContext]))
.thenReturn(IO.pure(Some(new GregorianCalendar(2018, 8, 26).getTime())))
when(mockGoogleGroupSyncPubSubDAO.publishMessages(any[String], any[Seq[MessageRequest]])).thenReturn(Future.successful(()))
when(
mockDirectoryDAO.updateGroupUpdatedDateAndVersionWithSession(
any[WorkbenchGroupIdentity],
any[SamRequestContext]
)
).thenReturn(IO.unit)

// mock ancestor call to establish nested group structure for owner policy and subgroup in managed group
when(mockDirectoryDAO.listAncestorGroups(WorkbenchGroupName(subGroupId), samRequestContext))
Expand Down

0 comments on commit df10db6

Please sign in to comment.