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 d1b3104
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
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;
import org.opensearch.client.opensearch._types.Result;
import org.opensearch.client.opensearch._types.Script;
import org.opensearch.client.opensearch._types.ScriptLanguage;
import org.opensearch.client.opensearch.core.BulkRequest;
import org.opensearch.client.opensearch.core.BulkResponse;
import org.opensearch.client.opensearch.core.DeleteResponse;
Expand Down Expand Up @@ -341,7 +341,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 +375,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 +412,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 +442,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,13 +20,13 @@
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;
import org.opensearch.client.opensearch._types.Refresh;
import org.opensearch.client.opensearch._types.Script;
import org.opensearch.client.opensearch._types.ScriptField;
import org.opensearch.client.opensearch._types.ScriptLanguage;
import org.opensearch.client.opensearch._types.SortOptions;
import org.opensearch.client.opensearch._types.SortOrder;
import org.opensearch.client.opensearch._types.query_dsl.FieldAndFormat;
Expand Down Expand Up @@ -209,7 +209,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 d1b3104

Please sign in to comment.