-
This unit test will index documents in bulk:
POST
call to the endpoint/es/_bulk
with bulkData in body.- The bulkData will be in ndjson form defined in init.go.
- Send a request to the server and response would be recorded.
- Using assert.Equal will test if the response code is equal to http.StatusOK (i.e 200),that means test is OK and documents are indexed.
-
This unit test will delete documents in bulk:
POST
call to the endpoint/es/_bulk
with bulkDataWithDelete in body.- The bulkDataWithDelete will be in ndjson form defined in init.go.
- Send a request to the server and response would be recorded.
- Using assert.Equal will test if the response code is equal to http.StatusOK (i.e 200),that means test is OK and documents are deleted.
-
This unit test will index documents with error input:
POST
call to the endpoint/es/_bulk
with{"index": {}}
in body .- Send a request to the server and response would be recorded.
- Using assert.Equal will test if the response code is equal to http.StatusOK (i.e 200),that means test is OK.