From 6ae403338914aebbf3642f9b03346c157a53d747 Mon Sep 17 00:00:00 2001 From: Neil Cook Date: Fri, 18 Oct 2024 09:01:05 +0100 Subject: [PATCH] Fix PutMappingTest tests had wrong error check condition --- .../endpoints/IndicesTest/PutMappingTest.lua | 36 +++---------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/tests/endpoints/IndicesTest/PutMappingTest.lua b/tests/endpoints/IndicesTest/PutMappingTest.lua index 91b9c55..335bcf4 100644 --- a/tests/endpoints/IndicesTest/PutMappingTest.lua +++ b/tests/endpoints/IndicesTest/PutMappingTest.lua @@ -33,26 +33,13 @@ function requestTest() mockTransport.method = "PUT" mockTransport.uri = "/_mapping" mockTransport.params = {} - mockTransport.body = parser.jsonEncode{ - properties = { - email = { - type = "keyword" - } - } - } + mockTransport.body = nill endpoint:setParams{ - body = { - properties = { - email = { - type = "keyword" - } - } - } } local _, err = endpoint:request() - assert_not_nil(err) + assert_nil(err) end -- Testing index request @@ -60,26 +47,13 @@ function requestIndexTest() mockTransport.method = "PUT" mockTransport.uri = "/users/_mapping" mockTransport.params = {} - mockTransport.body = parser.jsonEncode{ - properties = { - email = { - type = "keyword" - } - } - } + mockTransport.body = nil endpoint:setParams{ - index = "users", - body = { - properties = { - email = { - type = "keyword" - } - } - } + index = "users" } local _, err = endpoint:request() - assert_not_nil(err) + assert_nil(err) end