@@ -1082,6 +1082,27 @@ main = hspec $ do
10821082 L.find ((== alias) . indexAliasSummaryAlias) summs `shouldBe` Just expected
10831083 Left e -> expectationFailure ("Expected an IndexAliasesSummary but got " <> show e)) `finally` cleanup
10841084
1085+ it "handles an alias with routing and a filter" $ do
1086+ let alias = IndexAlias (testIndex) (IndexAliasName (IndexName "bloodhound-tests-twitter-1-alias"))
1087+ let sar = SearchAliasRouting (RoutingValue "search val" :| [])
1088+ let iar = IndexAliasRouting (RoutingValue "index val")
1089+ let routing = GranularAliasRouting (Just sar) (Just iar)
1090+ let filter = LimitFilter 42
1091+ let create = IndexAliasCreate (Just routing) (Just filter)
1092+ let action = AddAlias alias create
1093+
1094+ withTestEnv $ do
1095+ resetIndex
1096+ resp <- updateIndexAliases (action :| [])
1097+ liftIO $ NHTS.statusCode (responseStatus resp) `shouldBe` 200
1098+ let cleanup = withTestEnv (updateIndexAliases (RemoveAlias alias :| []))
1099+ (do aliases <- withTestEnv getIndexAliases
1100+ let expected = IndexAliasSummary alias create
1101+ case aliases of
1102+ Right (IndexAliasesSummary summs) ->
1103+ L.find ((== alias) . indexAliasSummaryAlias) summs `shouldBe` Just expected
1104+ Left e -> expectationFailure ("Expected an IndexAliasesSummary but got " <> show e)) `finally` cleanup
1105+
10851106 describe "JSON instances" $ do
10861107 propJSON (Proxy :: Proxy Version)
10871108 propJSON (Proxy :: Proxy IndexName)