Move ownership of libweave config to DeviceManager
It was not pretty that global config was owner by class responsible for
cloud communications.
Change-Id: I1476c610662a9773d38eb2fc64e1e2a5c769b63c
Reviewed-on: https://weave-review.googlesource.com/1826
Reviewed-by: Alex Vakulenko <avakulenko@google.com>
diff --git a/src/base_api_handler_unittest.cc b/src/base_api_handler_unittest.cc
index cdb6151..ca47626 100644
--- a/src/base_api_handler_unittest.cc
+++ b/src/base_api_handler_unittest.cc
@@ -53,11 +53,10 @@
.WillRepeatedly(Invoke(&component_manager_,
&ComponentManager::AddCommandHandler));
- std::unique_ptr<Config> config{new Config{&config_store_}};
- config->Load();
- dev_reg_.reset(new DeviceRegistrationInfo(&component_manager_,
- std::move(config), nullptr,
- &http_client_, nullptr, nullptr));
+ config_.Load();
+ dev_reg_.reset(new DeviceRegistrationInfo(&config_, &component_manager_,
+ nullptr, &http_client_, nullptr,
+ nullptr));
EXPECT_CALL(device_, GetSettings())
.WillRepeatedly(ReturnRef(dev_reg_->GetSettings()));
@@ -91,6 +90,7 @@
}
provider::test::MockConfigStore config_store_;
+ Config config_{&config_store_};
StrictMock<provider::test::MockHttpClient> http_client_;
std::unique_ptr<DeviceRegistrationInfo> dev_reg_;
ComponentManagerImpl component_manager_;