-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Default normalizer deserialization to custom type when unspecified (#…
…1111) * Default normalizer deserialization to custom type when unspecified Signed-off-by: beniamin.jedrychowsk <beniamin.jedrychowski@transatel.com> * fix style Signed-off-by: beniamin.jedrychowsk <beniamin.jedrychowski@transatel.com> * Update CHANGELOG.md fixed changelog formatting Co-authored-by: Thomas Farr <xtansia@xtansia.com> Signed-off-by: Beniamin Jędrychowski <beniamin.jedrychowski@transatel.com> --------- Signed-off-by: beniamin.jedrychowsk <beniamin.jedrychowski@transatel.com> Signed-off-by: Beniamin Jędrychowski <beniamin.jedrychowski@transatel.com> Co-authored-by: Thomas Farr <xtansia@xtansia.com> (cherry picked from commit 905aa34) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
725dbd3
commit 4ac63ce
Showing
3 changed files
with
26 additions
and
1 deletion.
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
24 changes: 24 additions & 0 deletions
24
...est/java/org/opensearch/client/opensearch/_types/analysis/NormalizerDeserializerTest.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,24 @@ | ||
/* | ||
* 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.analysis; | ||
|
||
import org.junit.Test; | ||
import org.opensearch.client.opensearch.model.ModelTestCase; | ||
|
||
public class NormalizerDeserializerTest extends ModelTestCase { | ||
|
||
@Test | ||
public void deserializesTypelessCustomAnalyzer() { | ||
String json = "{\n" + " \"filter\": \"lowercase\"\n" + " }"; | ||
|
||
Normalizer normalizer = fromJson(json, Normalizer._DESERIALIZER); | ||
assertTrue(normalizer.isCustom()); | ||
assertEquals("lowercase", normalizer.custom().filter().get(0)); | ||
} | ||
} |