aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/tests/storageserver/statereportertest.cpp
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@vespa.ai>2024-05-14 12:31:29 +0000
committerTor Brede Vekterli <vekterli@vespa.ai>2024-05-15 15:04:35 +0000
commit1e234886e11e1d4b78507d240e3bd7234f203466 (patch)
treea229b74828312ee8ee84d9408e603d3df684ed70 /storage/src/tests/storageserver/statereportertest.cpp
parentfc104fab59e2c4b74e07e1c5f2c253eea7efacfc (diff)
Remove usages of deprecated DirConfig in storage unit tests
Introduce a distinct `StorageConfigSet` which wraps the actual underlying config objects and exposes them through a unified `ConfigUri`.
Diffstat (limited to 'storage/src/tests/storageserver/statereportertest.cpp')
-rw-r--r--storage/src/tests/storageserver/statereportertest.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/storage/src/tests/storageserver/statereportertest.cpp b/storage/src/tests/storageserver/statereportertest.cpp
index c233c6e9314..29d3daf9b86 100644
--- a/storage/src/tests/storageserver/statereportertest.cpp
+++ b/storage/src/tests/storageserver/statereportertest.cpp
@@ -1,14 +1,15 @@
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include <tests/common/dummystoragelink.h>
+#include <tests/common/storage_config_set.h>
+#include <tests/common/teststorageapp.h>
+#include <tests/common/testhelper.h>
#include <vespa/storageframework/defaultimplementation/clock/fakeclock.h>
#include <vespa/storage/persistence/filestorage/filestormanager.h>
#include <vespa/storage/persistence/filestorage/filestormetrics.h>
#include <vespa/storage/storageserver/applicationgenerationfetcher.h>
#include <vespa/storage/storageserver/statereporter.h>
#include <vespa/metrics/metricmanager.h>
-#include <tests/common/teststorageapp.h>
-#include <tests/common/testhelper.h>
-#include <tests/common/dummystoragelink.h>
#include <vespa/config/common/exceptions.h>
#include <vespa/vespalib/data/slime/slime.h>
#include <vespa/vespalib/data/simple_buffer.h>
@@ -35,7 +36,7 @@ struct StateReporterTest : Test {
std::unique_ptr<DummyStorageLink> _top;
DummyApplicationGenerationFether _generationFetcher;
std::unique_ptr<StateReporter> _stateReporter;
- std::unique_ptr<vdstestlib::DirConfig> _config;
+ std::unique_ptr<StorageConfigSet> _config;
std::unique_ptr<metrics::MetricSet> _topSet;
std::unique_ptr<metrics::MetricManager> _metricManager;
std::shared_ptr<FileStorMetrics> _filestorMetrics;
@@ -68,9 +69,8 @@ StateReporterTest::StateReporterTest()
StateReporterTest::~StateReporterTest() = default;
void StateReporterTest::SetUp() {
- _config = std::make_unique<vdstestlib::DirConfig>(getStandardConfig(true, "statereportertest"));
-
- _node = std::make_unique<TestServiceLayerApp>(NodeIndex(0), _config->getConfigId());
+ _config = StorageConfigSet::make_storage_node_config();
+ _node = std::make_unique<TestServiceLayerApp>(NodeIndex(0), _config->config_uri());
_node->setupDummyPersistence();
_clock = &_node->getClock();
_clock->setAbsoluteTimeInSeconds(1000000);
@@ -90,7 +90,7 @@ void StateReporterTest::SetUp() {
_filestorMetrics->initDiskMetrics(1, 1);
_topSet->registerMetric(*_filestorMetrics);
- _metricManager->init(config::ConfigUri(_config->getConfigId()));
+ _metricManager->init(_config->config_uri());
}
void StateReporterTest::TearDown() {