Skip to content

Commit bf8958c

Browse files
committed
Add test for get SCIM group
1 parent b220e5d commit bf8958c

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

integration/test/API/Spar.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ createScimUserGroup domain token scimUserGroup = do
9797
body <- make scimUserGroup
9898
submit "POST" $ req & addJSON body . addHeader "Authorization" ("Bearer " <> token)
9999

100+
getScimUserGroup :: (HasCallStack, MakesValue domain) => domain -> String -> String -> App Response
101+
getScimUserGroup domain token gid = do
102+
req <- baseRequest domain Spar Versioned $ joinHttpPath [ "/scim/v2/Groups", gid ]
103+
submit "GET" $ req & addHeader "Authorization" ("Bearer " <> token)
104+
100105
-- | https://staging-nginz-https.zinfra.io/v12/api/swagger-ui/#/default/idp-create
101106
createIdp :: (HasCallStack, MakesValue user) => user -> SAML.IdPMetadata -> App Response
102107
createIdp user metadata = do

integration/test/Test/Spar.hs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,8 @@ testSparCreateScimTokenWithName = do
365365
----------------------------------------------------------------------
366366
-- scim group stuff
367367

368-
testSparScimCreateUserGroup :: (HasCallStack) => App ()
369-
testSparScimCreateUserGroup = do
368+
testSparScimCreateGetUserGroup :: (HasCallStack) => App ()
369+
testSparScimCreateGetUserGroup = do
370370
(owner, _, _) <- createTeam OwnDomain 1
371371
tok <- createScimTokenV6 owner def >>= \resp -> resp.json %. "token" >>= asString
372372
let scimUserGroup =
@@ -384,7 +384,11 @@ testSparScimCreateUserGroup = do
384384
resp <- createScimUserGroup OwnDomain tok scimUserGroup
385385
assertSuccess resp
386386

387-
-- get group here via resp
387+
gid <- resp.json %. "qualified_id.id" & asString
388+
389+
resp2 <- getScimUserGroup OwnDomain tok gid
390+
391+
liftIO $ print (resp, resp2)
388392

389393
----------------------------------------------------------------------
390394
-- saml stuff

0 commit comments

Comments
 (0)