aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/test/java/com/yahoo/vespa/model
diff options
context:
space:
mode:
Diffstat (limited to 'config-model/src/test/java/com/yahoo/vespa/model')
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/application/validation/ComplexFieldsValidatorTestCase.java5
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/search/test/SchemaClusterTest.java8
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/search/test/SchemaInfoTestCase.java2
3 files changed, 9 insertions, 6 deletions
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/ComplexFieldsValidatorTestCase.java b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/ComplexFieldsValidatorTestCase.java
index b2291099b44..ae1db366c9f 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/application/validation/ComplexFieldsValidatorTestCase.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/application/validation/ComplexFieldsValidatorTestCase.java
@@ -18,6 +18,7 @@ import java.util.List;
import java.util.logging.Level;
import static com.yahoo.config.model.test.TestUtil.joinLines;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -67,7 +68,9 @@ public class ComplexFieldsValidatorTestCase {
"}",
"}"));
});
- assertTrue(exception.getMessage().contains(getExpectedMessage("docTopics (docTopics.topics, docTopics.topics.id, docTopics.topics.label)")));
+ assertEquals("For schema 'test': Field 'docTopics.topics' of type 'array<topic>' cannot be an attribute." +
+ " Instead specify the struct fields to be searchable as attribute",
+ exception.getMessage());
}
@Test
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/search/test/SchemaClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/search/test/SchemaClusterTest.java
index f9999a30869..7809a97f85c 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/search/test/SchemaClusterTest.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/search/test/SchemaClusterTest.java
@@ -41,8 +41,8 @@ public class SchemaClusterTest {
SDDocumentType sdt1 = new SDDocumentType("s1");
Schema schema1 = new Schema("s1", MockApplicationPackage.createEmpty());
SDField f1 = new SDField(sdt1, "f1", DataType.STRING);
- f1.addAttribute(new Attribute("f1", DataType.STRING));
- f1.setIndexingScript(new ScriptExpression(new StatementExpression(new AttributeExpression("f1"))));
+ f1.addAttribute(new Attribute(schema1.getName(), f1.getName(), "f1", DataType.STRING));
+ f1.setIndexingScript("s1", new ScriptExpression(new StatementExpression(new AttributeExpression("f1"))));
sdt1.addField(f1);
schema1.addDocument(sdt1);
@@ -50,8 +50,8 @@ public class SchemaClusterTest {
SDDocumentType sdt2 = new SDDocumentType("s2");
Schema schema2 = new Schema("s2", MockApplicationPackage.createEmpty());
SDField f2 = new SDField(sdt2, "f2", DataType.STRING);
- f2.addAttribute(new Attribute("f2", DataType.STRING));
- f2.setIndexingScript(new ScriptExpression(new StatementExpression(new AttributeExpression("f2"))));
+ f2.addAttribute(new Attribute(schema2.getName(), f2.getName(), "f2", DataType.STRING));
+ f2.setIndexingScript("s2", new ScriptExpression(new StatementExpression(new AttributeExpression("f2"))));
sdt2.addField(f2);
schema2.addDocument(sdt2);
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/search/test/SchemaInfoTestCase.java b/config-model/src/test/java/com/yahoo/vespa/model/search/test/SchemaInfoTestCase.java
index 8502bfa92f4..672bba83e87 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/search/test/SchemaInfoTestCase.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/search/test/SchemaInfoTestCase.java
@@ -102,7 +102,7 @@ public class SchemaInfoTestCase {
var schemaInfoTester = new SchemaInfoTester();
var schema = schemaInfoTester.createSchema("test");
var field = (SDField)schema.getDocument().addField(new SDField("f1", DataType.STRING));
- var attribute = field.addAttribute(new Attribute("f1Attribute", field.getDataType()));
+ var attribute = field.addAttribute(new Attribute(schema.getName(), field.getName(), "f1Attribute", field.getDataType()));
attribute.getAliases().add("a1");
attribute.getAliases().add("a2");
assertEquals("""