diff --git a/java-client/src/test/java/co/elastic/clients/elasticsearch/model/BehaviorsTest.java b/java-client/src/test/java/co/elastic/clients/elasticsearch/model/BehaviorsTest.java index a67dd7df6..15693a3a4 100644 --- a/java-client/src/test/java/co/elastic/clients/elasticsearch/model/BehaviorsTest.java +++ b/java-client/src/test/java/co/elastic/clients/elasticsearch/model/BehaviorsTest.java @@ -223,74 +223,6 @@ public void testEnumShortcutProperty() { assertEquals(SortOrder.Asc, so.field().order()); } - @Test - public void testObjectShortcutProperty() { - - // Check that we look ahead to handle the shortcut - ObjectDeserializer deser = (ObjectDeserializer) LazyDeserializer.unwrap(RankEvalQuery._DESERIALIZER); - assertEquals("query", deser.shortcutProperty()); - assertTrue(deser.shortcutIsObject()); - - // Standard form - RankEvalQuery req = fromJson("{\"query\":{\"term\":{\"foo\":{\"value\":\"bar\"}}}}", RankEvalQuery.class); - - assertEquals("foo", req.query().term().field()); - assertEquals("bar", req.query().term().value().stringValue()); - - // Shortcut form - req = fromJson("{\"term\":{\"foo\":{\"value\":\"bar\"}}}", RankEvalQuery.class); - - assertEquals("foo", req.query().term().field()); - assertEquals("bar", req.query().term().value().stringValue()); - - // Nested shortcuts - req = fromJson("{\"term\":{\"foo\":\"bar\"}}", RankEvalQuery.class); - - assertEquals("foo", req.query().term().field()); - assertEquals("bar", req.query().term().value().stringValue()); - } - - @Test - public void testFunctionScoreQuery() { - String shortcut = - "{" + - " \"gauss\": {" + - " \"date\": {" + - " \"origin\": \"2013-09-17\", " + - " \"scale\": \"10d\"," + - " \"offset\": \"5d\", " + - " \"decay\": 0.5" + - " }," + - " \"multi_value_mode\": \"avg\"" + - " }" + - "}"; - - String full = - "{" + - " \"functions\": [" + - " {" + - " \"gauss\": {" + - " \"date\": {" + - " \"origin\": \"2013-09-17\"," + - " \"scale\": \"10d\"," + - " \"offset\": \"5d\"," + - " \"decay\": 0.5" + - " }," + - " \"multi_value_mode\": \"avg\"" + - " }" + - " }" + - " ]" + - "}"; - - FunctionScoreQuery fsq; - - fsq = fromJson(full, FunctionScoreQuery.class); - assertEquals(MultiValueMode.Avg, fsq.functions().get(0).gauss().untyped().multiValueMode()); - - fsq = fromJson(shortcut, FunctionScoreQuery.class); - assertEquals(MultiValueMode.Avg, fsq.functions().get(0).gauss().untyped().multiValueMode()); - } - @Test public void testWithNull() { diff --git a/java-client/src/test/java/co/elastic/clients/elasticsearch/model/UnionTests.java b/java-client/src/test/java/co/elastic/clients/elasticsearch/model/UnionTests.java index 8ea89306f..386f9f9ee 100644 --- a/java-client/src/test/java/co/elastic/clients/elasticsearch/model/UnionTests.java +++ b/java-client/src/test/java/co/elastic/clients/elasticsearch/model/UnionTests.java @@ -161,7 +161,7 @@ public void testUntaggedUnion() { .relation(RangeRelation.Contains)))); String expectedDateRangeQuery = "{\"range\":{\"day\":{\"boost\":1.0,\"relation\":\"contains\"," + - "\"gte\":\"20-06-24\",\"lte\":\"20-07-24\"},\"format\":\"some-format\"}}"; + "\"gte\":\"20-06-24\",\"lte\":\"20-07-24\",\"format\":\"some-format\"}}}"; assertEquals(expectedDateRangeQuery, toJson(dateRangeQuery));