feat: Add dosguard to new webserver (#1772)

For #919.
This commit is contained in:
Sergey Kuznetsov
2024-12-10 14:59:12 +00:00
committed by GitHub
parent 4ff2953257
commit 7bef13f913
23 changed files with 1325 additions and 148 deletions

View File

@@ -19,7 +19,7 @@
#include "util/AsioContextTestFixture.hpp"
#include "util/config/Config.hpp"
#include "web/dosguard/DOSGuardInterface.hpp"
#include "web/dosguard/DOSGuardMock.hpp"
#include "web/dosguard/IntervalSweepHandler.hpp"
#include <boost/json/parse.hpp>
@@ -40,10 +40,7 @@ protected:
}
)JSON";
struct DosGuardMock : BaseDOSGuard {
MOCK_METHOD(void, clear, (), (noexcept, override));
};
testing::StrictMock<DosGuardMock> guardMock;
DOSGuardStrictMock guardMock;
util::Config cfg{boost::json::parse(JSONData)};
IntervalSweepHandler sweepHandler{cfg, ctx, guardMock};