diff --git a/java-client/src/test/java/org/opensearch/client/opensearch/model/BehaviorsTest.java b/java-client/src/test/java/org/opensearch/client/opensearch/model/BehaviorsTest.java index d3fba08179..300eeef743 100644 --- a/java-client/src/test/java/org/opensearch/client/opensearch/model/BehaviorsTest.java +++ b/java-client/src/test/java/org/opensearch/client/opensearch/model/BehaviorsTest.java @@ -43,6 +43,7 @@ import org.opensearch.client.opensearch._types.query_dsl.ShapeQuery; import org.opensearch.client.opensearch._types.query_dsl.TermQuery; import org.opensearch.client.json.JsonData; +import org.opensearch.client.opensearch._types.query_dsl.WrapperQuery; import org.opensearch.client.util.MapBuilder; import org.junit.Test; @@ -84,6 +85,19 @@ public void testAdditionalPropertyOnClass() { System.out.println(toJson(q)); } + @Test + public void testWrapperQuery() { + WrapperQuery q = new WrapperQuery.Builder() + .query("encoded_query") + .build(); + + q = checkJsonRoundtrip(q, + "{\"query\":\"encoded_query\"}" + ); + + assertEquals("encoded_query", q.query()); + } + @Test public void testAdditionalPropertyOnContainer() { // Regular variant