Skip to content

Commit

Permalink
Add body to PutMapping Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
neilcook committed Oct 17, 2024
1 parent e9f3017 commit 4093ee1
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions tests/endpoints/IndicesTest/PutMappingTest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand Down

0 comments on commit 4093ee1

Please sign in to comment.