aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore/src/tests/proton/proton_config_fetcher
diff options
context:
space:
mode:
authorGeir Storli <geirst@yahoo-inc.com>2017-08-14 15:47:05 +0000
committerGeir Storli <geirst@yahoo-inc.com>2017-08-16 10:55:11 +0200
commit5d7ff977824a80cd1cecff859e429e922e597c79 (patch)
treec5031d14701f995d6b148af33c9a2b152ff3dcf4 /searchcore/src/tests/proton/proton_config_fetcher
parent64383fa4fdff3d52cb9c7a1838f7b9cdb14be960 (diff)
Change SchemaBuilder to use attributes config to setup imported attribute fields in schema.
Diffstat (limited to 'searchcore/src/tests/proton/proton_config_fetcher')
-rw-r--r--searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp b/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp
index 99d5090ed0d..6c682ea33e9 100644
--- a/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp
+++ b/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp
@@ -240,13 +240,12 @@ TEST_FF("require that documentdb config manager subscribes for config",
ASSERT_TRUE(f1.configEqual("typea", getDocumentDBConfig(f1, f2)));
}
-TEST_FF("require that documentdb config manager builds config with imported attribute fields",
+TEST_FF("require that documentdb config manager builds schema with imported attribute fields"
+ " and that they are filtered from resulting attribute config",
ConfigTestFixture("search"),
DocumentDBConfigManager(f1.configId + "/typea", "typea"))
{
auto *docType = f1.addDocType("typea");
- docType->importedFieldsBuilder.attribute.resize(1);
- docType->importedFieldsBuilder.attribute[0].name = "imported";
docType->attributesBuilder.attribute.resize(2);
docType->attributesBuilder.attribute[0].name = "imported";
docType->attributesBuilder.attribute[0].imported = true;
@@ -255,6 +254,9 @@ TEST_FF("require that documentdb config manager builds config with imported attr
const auto &schema = getDocumentDBConfig(f1, f2)->getSchemaSP();
EXPECT_EQUAL(1u, schema->getNumImportedAttributeFields());
EXPECT_EQUAL("imported", schema->getImportedAttributeFields()[0].getName());
+ EXPECT_EQUAL(1u, schema->getNumAttributeFields());
+ EXPECT_EQUAL("regular", schema->getAttributeFields()[0].getName());
+
const auto &attrCfg = getDocumentDBConfig(f1, f2)->getAttributesConfig();
EXPECT_EQUAL(1u, attrCfg.attribute.size());
EXPECT_EQUAL("regular", attrCfg.attribute[0].name);