From e57242f6bc2dc6d92ae372089de2d409b4ab4a4b Mon Sep 17 00:00:00 2001 From: Parvathi Date: Thu, 26 Dec 2024 12:40:55 +0530 Subject: [PATCH] uncommenting --- LegacyPlugin_WiFiManagerAPIs.cpp | 2 +- .../test_LegacyPlugin_WiFiManagerAPIs.cpp | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/LegacyPlugin_WiFiManagerAPIs.cpp b/LegacyPlugin_WiFiManagerAPIs.cpp index 8e67072..3369132 100644 --- a/LegacyPlugin_WiFiManagerAPIs.cpp +++ b/LegacyPlugin_WiFiManagerAPIs.cpp @@ -159,7 +159,7 @@ namespace WPEFramework Core::SystemInfo::SetEnvironment(_T("THUNDER_ACCESS"), (_T("127.0.0.1:9998"))); m_networkmanager = make_shared >(_T(NETWORK_MANAGER_CALLSIGN), _T("org.rdk.Wifi"), query); - //subscribeToEvents(); + subscribeToEvents(); return string(); } diff --git a/Tests/unit_test/test_LegacyPlugin_WiFiManagerAPIs.cpp b/Tests/unit_test/test_LegacyPlugin_WiFiManagerAPIs.cpp index a7cbd7d..66ed3fa 100644 --- a/Tests/unit_test/test_LegacyPlugin_WiFiManagerAPIs.cpp +++ b/Tests/unit_test/test_LegacyPlugin_WiFiManagerAPIs.cpp @@ -11,10 +11,17 @@ using namespace std; using namespace WPEFramework; using namespace WPEFramework::Plugin; using ::testing::NiceMock; +using ::testing::Return; + +class MockWiFiManager : public WiFiManager { +public: + MOCK_METHOD(void, subscribeToEvents, (), (override)); +} class WiFiManagerTest : public ::testing::Test { protected: - Core::ProxyType plugin; + // Core::ProxyType plugin; + Core::ProxyType plugin; Core::JSONRPC::Handler& handler; DECL_CORE_JSONRPC_CONX connection; Core::JSONRPC::Message message; @@ -22,7 +29,7 @@ class WiFiManagerTest : public ::testing::Test { ServiceMock services; WiFiManagerTest() - : plugin(Core::ProxyType::Create()) + : plugin(Core::ProxyType::Create()) //plugin(Core::ProxyType::Create()) , handler(*(plugin)) , INIT_CONX(1, 0) { @@ -48,6 +55,10 @@ class WiFiManagerInitializedTest : public WiFiManagerTest { EXPECT_EQ(name, string(_T("org.rdk.NetworkManager.1"))); return nullptr; })); + + EXPECT_CALL(*plugin, subscribeToEvents()) + .Times(1) + .WillOnce(Return()); } virtual ~WiFiManagerInitializedTest() override