diff --git a/src/agent/agent_info/src/agent_info_persistance.cpp b/src/agent/agent_info/src/agent_info_persistance.cpp index d51c80ce99..ffda1e5566 100644 --- a/src/agent/agent_info/src/agent_info_persistance.cpp +++ b/src/agent/agent_info/src/agent_info_persistance.cpp @@ -223,8 +223,10 @@ void AgentInfoPersistance::ResetToDefault() { try { - m_db->Remove(AGENT_INFO_TABLE_NAME); - m_db->Remove(AGENT_GROUP_TABLE_NAME); + m_db->DropTable(AGENT_INFO_TABLE_NAME); + m_db->DropTable(AGENT_GROUP_TABLE_NAME); + CreateAgentInfoTable(); + CreateAgentGroupTable(); InsertDefaultAgentInfo(); } catch (const std::exception& e) diff --git a/src/agent/tests/agent_registration_test.cpp b/src/agent/tests/agent_registration_test.cpp index 1a6a4ab24f..1d0978851d 100644 --- a/src/agent/tests/agent_registration_test.cpp +++ b/src/agent/tests/agent_registration_test.cpp @@ -78,7 +78,7 @@ TEST_F(RegisterTest, RegistrationTestSuccess) EXPECT_CALL(mockHttpClient, AuthenticateWithUserPassword(testing::_, testing::_, testing::_, testing::_)) .WillOnce(testing::Return("token")); - nlohmann::json bodyJson = agent->GetMetadataInfo(true); + const auto bodyJson = agent->GetMetadataInfo(true); http_client::HttpRequestParams reqParams(boost::beast::http::verb::post, "https://localhost:55000",