-
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.
Default normalizer deserialization to custom type when unspecified (#…
…1111) (#1114) * Default normalizer deserialization to custom type when unspecified * fix style * Update CHANGELOG.md fixed changelog formatting --------- (cherry picked from commit 905aa34) Signed-off-by: beniamin.jedrychowsk <[email protected]> Signed-off-by: Beniamin Jędrychowski <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Thomas Farr <[email protected]>
- Loading branch information
1 parent
725dbd3
commit c0efd41
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)); | ||
} | ||
} |