aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/test/java
diff options
context:
space:
mode:
authorHarald Musum <musum@yahooinc.com>2024-05-29 09:15:50 +0200
committerHarald Musum <musum@yahooinc.com>2024-05-29 09:15:50 +0200
commitad6fa8f9d5b9ba68779a2fe87faf5c71acfc0065 (patch)
tree2e066f27926b68ec0414c63f8e763e43866a93cd /config-model/src/test/java
parent8276854275b3daaf79d6774062bce6279981c4ba (diff)
Add test showing that inheriting a non-existent document summary gives NullPointerException
Today we give a warning and plan to fix this in Vespa 9. This test shows that we might as well throw as we get a NullPointerException and config server returns and internal server error when this happens, which is worse.
Diffstat (limited to 'config-model/src/test/java')
-rw-r--r--config-model/src/test/java/com/yahoo/schema/processing/SummaryConsistencyTestCase.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/config-model/src/test/java/com/yahoo/schema/processing/SummaryConsistencyTestCase.java b/config-model/src/test/java/com/yahoo/schema/processing/SummaryConsistencyTestCase.java
index 9eca2106c5e..1184e49b381 100644
--- a/config-model/src/test/java/com/yahoo/schema/processing/SummaryConsistencyTestCase.java
+++ b/config-model/src/test/java/com/yahoo/schema/processing/SummaryConsistencyTestCase.java
@@ -5,6 +5,7 @@ import com.yahoo.schema.Schema;
import com.yahoo.schema.ApplicationBuilder;
import com.yahoo.schema.parser.ParseException;
import com.yahoo.vespa.documentmodel.SummaryTransform;
+import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import static com.yahoo.config.model.test.TestUtil.joinLines;
@@ -42,4 +43,26 @@ public class SummaryConsistencyTestCase {
Schema schema = ApplicationBuilder.createFromString(sd).getSchema();
assertEquals(SummaryTransform.ATTRIBUTECOMBINER, schema.getSummaryField("elem_array_unfiltered").getTransform());
}
+
+ @Test
+ @Disabled
+ void testDocumentTypesWithInheritanceOfNonExistingField() throws ParseException {
+ String schemaString = """
+ schema foo {
+ document foo {
+ field foo type string {
+ indexing: summary
+ }
+ }
+ document-summary foo_summary inherits non-existent {
+ summary foo {
+ source: foo
+ }
+ }
+ }
+ """;
+ var schema = ApplicationBuilder.createFromString(schemaString).getSchema();
+ schema.getSummaryField("foo_summary");
+ }
+
}