From d1b310445a9de1faf8d1a97236495f4d4ae77b0a Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Wed, 9 Oct 2024 23:19:22 +1300 Subject: [PATCH] Fix tests Signed-off-by: Thomas Farr --- .../client/opensearch/integTest/AbstractCrudIT.java | 10 +++++----- .../integTest/AbstractMultiSearchRequestIT.java | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractCrudIT.java b/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractCrudIT.java index c9f6a26e9..0020a118e 100644 --- a/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractCrudIT.java +++ b/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractCrudIT.java @@ -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; @@ -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() @@ -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() @@ -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() ) @@ -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() ) diff --git a/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractMultiSearchRequestIT.java b/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractMultiSearchRequestIT.java index 38f25ec72..e889aa06f 100644 --- a/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractMultiSearchRequestIT.java +++ b/java-client/src/test/java11/org/opensearch/client/opensearch/integTest/AbstractMultiSearchRequestIT.java @@ -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; @@ -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()