Skip to content

Commit

Permalink
fix(test): syntax violation of json with one too many closing curly b…
Browse files Browse the repository at this point in the history
…rackets
  • Loading branch information
tuunit committed Jan 17, 2025
1 parent 1f9502c commit 595f24c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions providers/google_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,31 +238,31 @@ func TestGoogleProviderGetEmailAddressEmailMissing(t *testing.T) {
func TestGoogleProvider_userInGroup(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/admin/directory/v1/groups/[email protected]/hasMember/[email protected]" {
fmt.Fprintln(w, `{"isMember": true}`)
fmt.Fprintln(w, `{"isMember":true}`)
} else if r.URL.Path == "/admin/directory/v1/groups/[email protected]/hasMember/[email protected]" {
fmt.Fprintln(w, `{"isMember": false}`)
fmt.Fprintln(w, `{"isMember":false}`)
} else if r.URL.Path == "/admin/directory/v1/groups/[email protected]/hasMember/[email protected]" {
http.Error(
w,
`{"error": {"errors": [{"domain": "global","reason": "invalid","message": "Invalid Input: memberKey"}],"code": 400,"message": "Invalid Input: memberKey"}}`,
`{"error":{"errors":[{"domain":"global","reason":"invalid","message":"Invalid Input: memberKey"}],"code":400,"message":"Invalid Input: memberKey"}}`,
http.StatusBadRequest,
)
} else if r.URL.Path == "/admin/directory/v1/groups/[email protected]/hasMember/[email protected]" {
http.Error(
w,
`{"error": {"errors": [{"domain": "global","reason": "invalid","message": "Invalid Input: memberKey"}],"code": 400,"message": "Invalid Input: memberKey"}}`,
`{"error":{"errors":[{"domain":"global","reason":"invalid","message":"Invalid Input: memberKey"}],"code":400,"message":"Invalid Input: memberKey"}}`,
http.StatusBadRequest,
)
} else if r.URL.Path == "/admin/directory/v1/groups/[email protected]/members/[email protected]" {
// note that the client currently doesn't care what this response text or code is - any error here results in failure to match the group
http.Error(
w,
`{"error": {"errors": [{"domain": "global","reason": "notFound","message": "Resource Not Found: memberKey"}],"code": 404,"message": "Resource Not Found: memberKey"}}`,
`{"kind":"admin#directory#member","etag":"12345","id":"1234567890","email":"[email protected]","role":"MEMBER","type":"USER","status":"ACTIVE","delivery_settings":"ALL_MAIL"}`,
http.StatusNotFound,
)
} else if r.URL.Path == "/admin/directory/v1/groups/[email protected]/members/[email protected]" {
fmt.Fprintln(w,
`{"kind": "admin#directory#member","etag":"12345","id":"1234567890","email": "[email protected]","role": "MEMBER","type": "USER","status": "ACTIVE","delivery_settings": "ALL_MAIL"}}`,
`{"kind":"admin#directory#member","etag":"12345","id":"1234567890","email":"[email protected]","role":"MEMBER","type":"USER","status":"ACTIVE","delivery_settings":"ALL_MAIL"}`,
)
}
}))
Expand Down

0 comments on commit 595f24c

Please sign in to comment.