From d347bddf6418667f6726d8bacf314ee14d33a9fe Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Wed, 11 Dec 2024 14:08:24 +1300 Subject: [PATCH] Add failing test Signed-off-by: Thomas Farr --- .../aggregations/FilterAggregateTest.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 java-client/src/test/java/org/opensearch/client/opensearch/_types/aggregations/FilterAggregateTest.java diff --git a/java-client/src/test/java/org/opensearch/client/opensearch/_types/aggregations/FilterAggregateTest.java b/java-client/src/test/java/org/opensearch/client/opensearch/_types/aggregations/FilterAggregateTest.java new file mode 100644 index 0000000000..ad031fa432 --- /dev/null +++ b/java-client/src/test/java/org/opensearch/client/opensearch/_types/aggregations/FilterAggregateTest.java @@ -0,0 +1,21 @@ +/* + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ + +package org.opensearch.client.opensearch._types.aggregations; + +import org.junit.Test; +import org.opensearch.client.opensearch.model.ModelTestCase; + +public class FilterAggregateTest extends ModelTestCase { + @Test + public void serializesNestedAggregates() { + String json = "{\"sum#l2_result\":{\"value\":1.0},\"doc_count\":1}"; + FilterAggregate aggregate = fromJson(json, FilterAggregate._DESERIALIZER); + assertEquals(json, toJson(aggregate)); + } +}