diff --git a/cardano-wallet.cabal b/cardano-wallet.cabal index 77448821f5e..7f27b44934f 100644 --- a/cardano-wallet.cabal +++ b/cardano-wallet.cabal @@ -164,11 +164,14 @@ test-suite integration , hspec , hspec-core , http-client + , http-api-data , http-types + , aeson-qq , lens , mtl , process , say + , template-haskell , text , transformers diff --git a/test/integration/Test/Integration/Framework/DSL.hs b/test/integration/Test/Integration/Framework/DSL.hs index 1effcf4fbb3..f2c8684d27c 100644 --- a/test/integration/Test/Integration/Framework/DSL.hs +++ b/test/integration/Test/Integration/Framework/DSL.hs @@ -23,6 +23,9 @@ module Test.Integration.Framework.DSL -- * Helpers , ($-) + , () + , (!!) + , json ) where import Prelude hiding @@ -34,12 +37,18 @@ import Control.Monad.Fail ( MonadFail (..) ) import Control.Monad.IO.Class ( MonadIO, liftIO ) +import Data.Aeson.QQ + ( aesonQQ ) import Data.Function ( (&) ) +import Data.List + ( (!!) ) import Data.Text ( Text ) import GHC.Generics ( Generic ) +import Language.Haskell.TH.Quote + ( QuasiQuoter ) import Network.HTTP.Client ( Manager ) import Test.Hspec.Core.Spec @@ -51,6 +60,8 @@ import Test.Integration.Framework.Request ( RequestException (..), request, request_, successfulRequest, ($-) ) import Test.Integration.Framework.Scenario ( Scenario ) +import Web.HttpApiData + ( ToHttpApiData (..) ) -- -- SCENARIO @@ -132,3 +143,15 @@ wantedErrorButSuccess -> m void wantedErrorButSuccess = fail . ("expected an error but got a successful response: " <>) . show + + +-- +-- HELPERS +-- + +json :: QuasiQuoter +json = aesonQQ + +infixr 5 +() :: ToHttpApiData a => Text -> a -> Text +base next = mconcat [base, "/", toQueryParam next]