hscim-0.4.0.3: hscim json schema and server implementation
Safe HaskellSafe-Inferred
LanguageHaskell2010

Web.Scim.Test.Util

Synopsis

Documentation

shouldRespondWith :: HasCallStack => WaiSession st SResponse -> ResponseMatcher -> WaiExpectation st Source #

re-implementation of shouldRespondWith with better error reporting. FUTUREWORK: make this a PR upstream. (while we're at it, we can also patch WaiSession and request to keep track of the SRequest, and add that to the error message here with the response.)

Making wai requests

data AcceptanceConfig tag Source #

Constructors

AcceptanceConfig 

Fields

(<//>) :: ByteString -> ByteString -> ByteString Source #

avoid multiple /. (kill at most one / at the end of first arg and beginning of second arg, resp., then add one during concatenation.

>>> ["a" <//> "b", "a" <//> "/b", "a/" <//> "b", "a/" <//> "/b"]
["a/b","a/b","a/b","a/b"]

WARNING: {doctests don't work in our infrastructure](https:/github.comzinfrabackend-issuesissues/1549), so this is duplicated in the unit tests.

Request/response quasiquoter

scim :: QuasiQuoter Source #

A response matcher and quasiquoter that should be used instead of json.

JSON parsing

newtype Field (s :: Symbol) a Source #

A way to parse out a single value from a JSON object by specifying the field as a type-level string. Very useful when you don't want to create extra types.

Constructors

Field a 

Instances

Instances details
Functor (Field s) Source # 
Instance details

Defined in Web.Scim.Test.Util

Methods

fmap :: (a -> b) -> Field s a -> Field s b #

(<$) :: a -> Field s b -> Field s a #

(KnownSymbol s, FromJSON a) => FromJSON (Field s a) Source # 
Instance details

Defined in Web.Scim.Test.Util

Methods

parseJSON :: Value -> Parser (Field s a) #

parseJSONList :: Value -> Parser [Field s a] #

(KnownSymbol s, ToJSON a) => ToJSON (Field s a) Source # 
Instance details

Defined in Web.Scim.Test.Util

Methods

toJSON :: Field s a -> Value #

toEncoding :: Field s a -> Encoding #

toJSONList :: [Field s a] -> Value #

toEncodingList :: [Field s a] -> Encoding #

Read a => Read (Field s a) Source # 
Instance details

Defined in Web.Scim.Test.Util

Show a => Show (Field s a) Source # 
Instance details

Defined in Web.Scim.Test.Util

Methods

showsPrec :: Int -> Field s a -> ShowS #

show :: Field s a -> String #

showList :: [Field s a] -> ShowS #

Eq a => Eq (Field s a) Source # 
Instance details

Defined in Web.Scim.Test.Util

Methods

(==) :: Field s a -> Field s a -> Bool #

(/=) :: Field s a -> Field s a -> Bool #

Ord a => Ord (Field s a) Source # 
Instance details

Defined in Web.Scim.Test.Util

Methods

compare :: Field s a -> Field s a -> Ordering #

(<) :: Field s a -> Field s a -> Bool #

(<=) :: Field s a -> Field s a -> Bool #

(>) :: Field s a -> Field s a -> Bool #

(>=) :: Field s a -> Field s a -> Bool #

max :: Field s a -> Field s a -> Field s a #

min :: Field s a -> Field s a -> Field s a #

getField :: Field s a -> a Source #

Tag

data TestTag id authData authInfo userExtra Source #

A type-level tag for UserTypes, AuthTypes, etc. that allows picking any types we might need in tests.

Instances

Instances details
AuthTypes (TestTag id authData authInfo userExtra) Source # 
Instance details

Defined in Web.Scim.Test.Util

Associated Types

type AuthData (TestTag id authData authInfo userExtra) Source #

type AuthInfo (TestTag id authData authInfo userExtra) Source #

GroupTypes (TestTag id authData authInfo userExtra) Source # 
Instance details

Defined in Web.Scim.Test.Util

Associated Types

type GroupId (TestTag id authData authInfo userExtra) Source #

UserTypes (TestTag id authData authInfo userExtra) Source # 
Instance details

Defined in Web.Scim.Test.Util

Associated Types

type UserId (TestTag id authData authInfo userExtra) Source #

type UserExtra (TestTag id authData authInfo userExtra) Source #

type AuthData (TestTag id authData authInfo userExtra) Source # 
Instance details

Defined in Web.Scim.Test.Util

type AuthData (TestTag id authData authInfo userExtra) = authData
type AuthInfo (TestTag id authData authInfo userExtra) Source # 
Instance details

Defined in Web.Scim.Test.Util

type AuthInfo (TestTag id authData authInfo userExtra) = authInfo
type GroupId (TestTag id authData authInfo userExtra) Source # 
Instance details

Defined in Web.Scim.Test.Util

type GroupId (TestTag id authData authInfo userExtra) = id
type UserExtra (TestTag id authData authInfo userExtra) Source # 
Instance details

Defined in Web.Scim.Test.Util

type UserExtra (TestTag id authData authInfo userExtra) = userExtra
type UserId (TestTag id authData authInfo userExtra) Source # 
Instance details

Defined in Web.Scim.Test.Util

type UserId (TestTag id authData authInfo userExtra) = id