-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix serialization of time_zone field in CompositeDateHistogramAggrega…
…tionSource (#1362) * Fix serialization of time_zone field in CompositeDateHistogramAggregationSource Signed-off-by: Fabien Crespel <[email protected]> * Add test for CompositeDateHistogramAggregationSource Signed-off-by: Fabien Crespel <[email protected]> --------- Signed-off-by: Fabien Crespel <[email protected]>
- Loading branch information
Showing
3 changed files
with
55 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...ch/client/opensearch/_types/aggregations/CompositeDateHistogramAggregationSourceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* 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 CompositeDateHistogramAggregationSourceTest extends ModelTestCase { | ||
|
||
@Test | ||
public void testSerializeSpecificFields() { | ||
String json = "{\"calendar_interval\":\"1d\",\"fixed_interval\":\"1d\",\"offset\":1,\"time_zone\":\"+01:00\"}"; | ||
CompositeDateHistogramAggregationSource aggregation = fromJson(json, CompositeDateHistogramAggregationSource._DESERIALIZER); | ||
assertEquals(json, toJson(aggregation)); | ||
} | ||
|
||
} |