From 4093ee1c606ba95b2a00466b691eae85daee3298 Mon Sep 17 00:00:00 2001 From: Neil Cook Date: Thu, 17 Oct 2024 17:06:51 +0100 Subject: [PATCH] Add body to PutMapping Tests --- .../endpoints/IndicesTest/PutMappingTest.lua | 35 ++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/tests/endpoints/IndicesTest/PutMappingTest.lua b/tests/endpoints/IndicesTest/PutMappingTest.lua index 9482496..807a02a 100644 --- a/tests/endpoints/IndicesTest/PutMappingTest.lua +++ b/tests/endpoints/IndicesTest/PutMappingTest.lua @@ -32,9 +32,23 @@ function requestTest() mockTransport.method = "PUT" mockTransport.uri = "/_mapping" mockTransport.params = {} - mockTransport.body = nil + mockTransport.body = parser.jsonEncode{ + properties = { + email = { + type = "keyword" + } + } + } - endpoint:setParams{} + endpoint:setParams{ + body = { + properties = { + email = { + type = "keyword" + } + } + } + } local _, err = endpoint:request() assert_not_nil(err) @@ -45,10 +59,23 @@ function requestIndexTest() mockTransport.method = "PUT" mockTransport.uri = "/users/_mapping" mockTransport.params = {} - mockTransport.body = nil + mockTransport.body = parser.jsonEncode{ + properties = { + email = { + type = "keyword" + } + } + } endpoint:setParams{ - index = "users" + index = "users", + body = { + properties = { + email = { + type = "keyword" + } + } + } } local _, err = endpoint:request()