summaryrefslogtreecommitdiffstats
path: root/config/src/tests/configretriever
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-02-05 23:32:00 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2022-02-06 00:26:08 +0000
commit4c5a7cac411b30b9b4bd3ca067efcc9f3719b0ea (patch)
tree2e09c62b854357bbb1c8d433898d004e3f3995a5 /config/src/tests/configretriever
parentb84ef936b1cedce0b99f79e03b2fe25a8db5f7c3 (diff)
Reduce code visibility and include only what you need from config library.
Diffstat (limited to 'config/src/tests/configretriever')
-rw-r--r--config/src/tests/configretriever/configretriever.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/config/src/tests/configretriever/configretriever.cpp b/config/src/tests/configretriever/configretriever.cpp
index dbbcd0dec24..fdd106e44f2 100644
--- a/config/src/tests/configretriever/configretriever.cpp
+++ b/config/src/tests/configretriever/configretriever.cpp
@@ -14,6 +14,8 @@
#include <vespa/config/subscription/configsubscription.h>
#include <vespa/config/subscription/sourcespec.h>
#include <vespa/config/common/exceptions.h>
+#include <vespa/config/frt/protocol.h>
+#include <vespa/config/retriever/configsnapshot.hpp>
#include <thread>
#include <atomic>
@@ -34,7 +36,7 @@ struct ConfigTestFixture {
BootstrapConfigBuilder bootstrapBuilder;
map<std::string, ComponentFixture::SP> componentConfig;
ConfigSet set;
- IConfigContext::SP context;
+ std::shared_ptr<IConfigContext> context;
int idcounter;
ConfigTestFixture(const std::string & id)
@@ -115,11 +117,11 @@ struct MySource : public Source
struct SubscriptionFixture
{
- IConfigHolder::SP holder;
- ConfigSubscription::SP sub;
+ std::shared_ptr<IConfigHolder> holder;
+ std::shared_ptr<ConfigSubscription> sub;
SubscriptionFixture(const ConfigKey & key, const ConfigValue value)
- : holder(new ConfigHolder()),
- sub(new ConfigSubscription(0, key, holder, Source::UP(new MySource())))
+ : holder(std::make_shared<ConfigHolder>()),
+ sub(std::make_shared<ConfigSubscription>(0, key, holder, std::make_unique<MySource>()))
{
holder->handle(std::make_unique<ConfigUpdate>(value, 3, 3));
ASSERT_TRUE(sub->nextUpdate(0, 0ms));
@@ -215,7 +217,7 @@ TEST("require that SimpleConfigRetriever usage works") {
barBuilder.barValue = "fooz";
set.addBuilder("id", &fooBuilder);
set.addBuilder("id", &barBuilder);
- IConfigContext::SP ctx(new ConfigContext(set));
+ auto ctx = std::make_shared<ConfigContext>(set);
ConfigKeySet sub;
sub.add<FooConfig>("id");
sub.add<BarConfig>("id");
@@ -281,7 +283,7 @@ TEST_F("require that SimpleConfigurer usage works", ConfigurableFixture()) {
barBuilder.barValue = "fooz";
set.addBuilder("id", &fooBuilder);
set.addBuilder("id", &barBuilder);
- IConfigContext::SP ctx(new ConfigContext(set));
+ auto ctx = std::make_shared<ConfigContext>(set);
ConfigKeySet sub;
sub.add<FooConfig>("id");
sub.add<BarConfig>("id");