Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia committed Oct 9, 2024
1 parent 2fa5d03 commit 92d4e70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormat;
import org.opensearch.client.json.JsonData;
import org.opensearch.client.opensearch._types.BuiltinScriptLanguage;
import org.opensearch.client.opensearch._types.InlineScript;
import org.opensearch.client.opensearch._types.OpenSearchException;
import org.opensearch.client.opensearch._types.Refresh;
Expand Down Expand Up @@ -341,7 +342,7 @@ public void testBulkUpdateScript() throws IOException {
.script(
Script.of(
s -> s.inline(
new InlineScript.Builder().lang(ScriptLanguage.Painless)
new InlineScript.Builder().lang(l -> l.builtin(BuiltinScriptLanguage.Painless))
.source("ctx._source.intValue += params.inc")
.params("inc", JsonData.of(1))
.build()
Expand Down Expand Up @@ -375,7 +376,7 @@ public void testBulkUpdateScriptUpsert() throws IOException {
.script(
Script.of(
s -> s.inline(
new InlineScript.Builder().lang(ScriptLanguage.Painless)
new InlineScript.Builder().lang(l -> l.builtin(BuiltinScriptLanguage.Painless))
.source("ctx._source.intValue += params.inc")
.params("inc", JsonData.of(1))
.build()
Expand Down Expand Up @@ -412,7 +413,7 @@ public void testBulkUpdateScriptedUpsertUpdate() throws IOException {
.script(
Script.of(
s -> s.inline(
new InlineScript.Builder().lang(ScriptLanguage.Painless)
new InlineScript.Builder().lang(l -> l.builtin(BuiltinScriptLanguage.Painless))
.source("ctx._source.intValue = ctx?._source?.intValue == null ? 7777 : 9999")
.build()
)
Expand Down Expand Up @@ -442,7 +443,7 @@ public void testBulkUpdateScriptedUpsertInsert() throws IOException {
.script(
Script.of(
s -> s.inline(
new InlineScript.Builder().lang(ScriptLanguage.Painless)
new InlineScript.Builder().lang(l -> l.builtin(BuiltinScriptLanguage.Painless))
.source("ctx._source.intValue = ctx?._source?.intValue == null ? 7777 : 9999")
.build()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.util.function.Function;
import org.junit.Test;
import org.opensearch.client.json.JsonData;
import org.opensearch.client.opensearch._types.BuiltinScriptLanguage;
import org.opensearch.client.opensearch._types.FieldSort;
import org.opensearch.client.opensearch._types.FieldValue;
import org.opensearch.client.opensearch._types.InlineScript;
Expand Down Expand Up @@ -209,7 +210,7 @@ public void shouldReturnMultiSearchesScriptFields() throws Exception {
new ScriptField.Builder().script(
Script.of(
s -> s.inline(
new InlineScript.Builder().lang(ScriptLanguage.Painless)
new InlineScript.Builder().lang(l -> l.builtin(BuiltinScriptLanguage.Painless))
.source("doc['quantity'].value + params.inc")
.params("inc", JsonData.of(1))
.build()
Expand Down

0 comments on commit 92d4e70

Please sign in to comment.