aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/tests/storageserver/statemanagertest.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/statemanagertest.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/statemanagertest.cpp')
-rw-r--r--storage/src/tests/storageserver/statemanagertest.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/storage/src/tests/storageserver/statemanagertest.cpp b/storage/src/tests/storageserver/statemanagertest.cpp
index 2a5af397aca..b785bc141b6 100644
--- a/storage/src/tests/storageserver/statemanagertest.cpp
+++ b/storage/src/tests/storageserver/statemanagertest.cpp
@@ -1,13 +1,14 @@
// 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/storageapi/message/bucket.h>
#include <vespa/storageapi/message/state.h>
#include <vespa/vdslib/state/cluster_state_bundle.h>
#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/storage/storageserver/statemanager.h>
-#include <tests/common/teststorageapp.h>
-#include <tests/common/testhelper.h>
-#include <tests/common/dummystoragelink.h>
#include <vespa/vespalib/data/slime/slime.h>
#include <vespa/vespalib/gtest/gtest.h>
@@ -20,6 +21,7 @@ using namespace ::testing;
namespace storage {
struct StateManagerTest : Test, NodeStateReporter {
+ std::unique_ptr<StorageConfigSet> _config;
std::unique_ptr<TestServiceLayerApp> _node;
std::unique_ptr<DummyStorageLink> _upper;
StateManager* _manager;
@@ -46,7 +48,8 @@ struct StateManagerTest : Test, NodeStateReporter {
};
StateManagerTest::StateManagerTest()
- : _node(),
+ : _config(),
+ _node(),
_upper(),
_manager(nullptr),
_lower(nullptr)
@@ -56,7 +59,8 @@ StateManagerTest::StateManagerTest()
void
StateManagerTest::SetUp()
{
- _node = std::make_unique<TestServiceLayerApp>(NodeIndex(2));
+ _config = StorageConfigSet::make_storage_node_config();
+ _node = std::make_unique<TestServiceLayerApp>(NodeIndex(2), _config->config_uri());
// Clock will increase 1 sec per call.
_node->getClock().setAbsoluteTimeInSeconds(1);
_upper = std::make_unique<DummyStorageLink>();