Skip to content

Commit

Permalink
Fix PutMappingTest tests had wrong error check condition
Browse files Browse the repository at this point in the history
  • Loading branch information
neilcook committed Oct 18, 2024
1 parent b2483dd commit 6ae4033
Showing 1 changed file with 5 additions and 31 deletions.
36 changes: 5 additions & 31 deletions tests/endpoints/IndicesTest/PutMappingTest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,53 +33,27 @@ 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
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

0 comments on commit 6ae4033

Please sign in to comment.