Skip to content

Commit

Permalink
Use latest API version in cargohold
Browse files Browse the repository at this point in the history
  • Loading branch information
pcapriotti committed Sep 21, 2022
1 parent fb371d7 commit 262cf16
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions services/cargohold/cargohold.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ executable cargohold-integration
, extended
, federator
, HsOpenSSL >=0.11
, http-api-data
, http-client >=0.4
, http-client-tls >=0.2
, http-media
Expand Down
10 changes: 9 additions & 1 deletion services/cargohold/test/integration/TestSetup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ import Test.Tasty.HUnit
import Util.Options
import Util.Options.Common
import Util.Test
import Web.HttpApiData
import Wire.API.Federation.Domain
import Wire.API.Routes.Version

type Cargohold = Request -> Request

Expand Down Expand Up @@ -111,7 +113,13 @@ unversioned r =
}

viewCargohold :: TestM Cargohold
viewCargohold = fmap (apiVersion "v2" .) viewUnversionedCargohold
viewCargohold =
fmap
(apiVersion ("v" <> toHeader latestVersion) .)
viewUnversionedCargohold
where
latestVersion :: Version
latestVersion = maxBound

viewUnversionedCargohold :: TestM Cargohold
viewUnversionedCargohold = mkRequest <$> view tsEndpoint
Expand Down

0 comments on commit 262cf16

Please sign in to comment.