diff options
author | Jon Bratseth <bratseth@gmail.com> | 2021-10-18 13:53:31 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2021-10-18 13:53:31 +0200 |
commit | fdfdc83dab661fdef0da968392f3f50708b4b74f (patch) | |
tree | 3c4b5589ab8e43f4615a0f0582f400837ac65ab2 /config-model/src/test/java/com/yahoo/searchdefinition | |
parent | 107c889b203a1e73dd342450a538459b4911c7fd (diff) |
Inherit fields
Diffstat (limited to 'config-model/src/test/java/com/yahoo/searchdefinition')
-rw-r--r-- | config-model/src/test/java/com/yahoo/searchdefinition/SchemaTestCase.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/config-model/src/test/java/com/yahoo/searchdefinition/SchemaTestCase.java b/config-model/src/test/java/com/yahoo/searchdefinition/SchemaTestCase.java index 16b01563e55..07cba46c801 100644 --- a/config-model/src/test/java/com/yahoo/searchdefinition/SchemaTestCase.java +++ b/config-model/src/test/java/com/yahoo/searchdefinition/SchemaTestCase.java @@ -8,6 +8,7 @@ import org.junit.Test; import static com.yahoo.config.model.test.TestUtil.joinLines; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -81,6 +82,9 @@ public class SchemaTestCase { " index parent_index {" + " stemming: best" + " }" + + " field parent_field type string {" + + " indexing: input pf1 | lowercase | index | attribute | summary" + + " }" + "}"); String childLines = joinLines( "schema child inherits parent {" + @@ -92,10 +96,11 @@ public class SchemaTestCase { "}"); var application = SearchBuilder.createFromStrings(new DeployLoggerStub(), parentLines, childLines).application(); var child = application.schemas().get("child"); - assertEquals("pf1", child.fieldSets().userFieldSets().get("parent_set").getFieldNames().stream().findFirst().get()); assertEquals(Stemming.NONE, child.getStemming()); assertEquals(Stemming.BEST, child.getIndex("parent_index").getStemming()); + assertNotNull(child.getField("parent_field")); + assertNotNull(child.getExtraField("parent_field")); } } |