How to write unit test for Elasticsearch painless scripts using Java

Viewed 78

Here is my sample painles script used in Elasticsearch. I want to write a unit test for this. How can I achieve it?

{
  "script": {
    "source": """
       for(param in params.entrySet()) {
         ctx.source.put(param.getKey(), param.getValue())
      }
    "lang": "painless",
    "params": {
      "sold_cost": 26
    }
  }
}
0 Answers
Related