@@ -96,6 +96,9 @@ es15 = Vers.Version [1, 5, 0] []
9696es16 :: Vers.Version
9797es16 = Vers.Version [1, 6, 0] []
9898
99+es20 :: Vers.Version
100+es20 = Vers.Version [2, 0, 0] []
101+
99102getServerVersion :: IO (Maybe Vers.Version)
100103getServerVersion = fmap extractVersion <$> withTestEnv getStatus
101104 where
@@ -885,12 +888,17 @@ main = hspec $ do
885888 validateStatus resp 200
886889 validateStatus deleteResp 200
887890
888− describe "error parsing" $ do
889− it "can parse EsErrors" $ withTestEnv $ do
891+ describe "error parsing" $ do
892+ it "can parse EsErrors for < 2.0" $ when' (atmost es16) $ withTestEnv $ do
890893 res <- getDocument (IndexName "bogus") (MappingName "also_bogus") (DocId "bogus_as_well")
891894 let errorResp = eitherDecode (responseBody res)
892895 liftIO (errorResp `shouldBe` Right (EsError 404 "IndexMissingException[[bogus] missing]"))
893896
897+ it "can parse EsErrors for >= 2.0" $ when' (atleast es20) $ withTestEnv $ do
898+ res <- getDocument (IndexName "bogus") (MappingName "also_bogus") (DocId "bogus_as_well")
899+ let errorResp = eitherDecode (responseBody res)
900+ liftIO (errorResp `shouldBe` Right (EsError 404 "no such index"))
901+
894902 describe "document API" $ do
895903 it "indexes, updates, gets, and then deletes the generated document" $ withTestEnv $ do
896904 _ <- insertData