From d427e200e95db91d0f979581cfc271036ec518c6 Mon Sep 17 00:00:00 2001 From: Michel Wohlert Date: Tue, 14 Nov 2023 13:37:04 -0800 Subject: [PATCH] Allow overriding DI injected variables in ClientServerTestRunner Move OATPP_COMPONENT calls to constructor to allow supplying variables without using DI --- src/oatpp-test/web/ClientServerTestRunner.hpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/oatpp-test/web/ClientServerTestRunner.hpp b/src/oatpp-test/web/ClientServerTestRunner.hpp index 696988f8..a801ea44 100644 --- a/src/oatpp-test/web/ClientServerTestRunner.hpp +++ b/src/oatpp-test/web/ClientServerTestRunner.hpp @@ -51,10 +51,18 @@ public: private: std::shared_ptr m_server; std::list> m_controllers; - OATPP_COMPONENT(std::shared_ptr, m_router); - OATPP_COMPONENT(std::shared_ptr, m_connectionProvider); - OATPP_COMPONENT(std::shared_ptr, m_connectionHandler); + std::shared_ptr m_router; + std::shared_ptr m_connectionProvider; + std::shared_ptr m_connectionHandler; + public: + ClientServerTestRunner(OATPP_COMPONENT(std::shared_ptr, router), + OATPP_COMPONENT(std::shared_ptr, connectionProvider), + OATPP_COMPONENT(std::shared_ptr, connectionHandler)) + : m_router(router) + , m_connectionProvider(connectionProvider) + , m_connectionHandler(connectionHandler) + {} std::shared_ptr getRouter() { return m_router;