Подготовка интеграционного теста

This commit is contained in:
Антон
2025-10-17 08:51:16 +03:00
parent 38a8d5effd
commit d0ad4ae189
3 changed files with 18 additions and 4 deletions
+6 -1
View File
@@ -1,4 +1,5 @@
#pragma once
#include <boost/log/trivial.hpp>
#include <regex>
#include <boost/json.hpp>
@@ -35,6 +36,8 @@ public:
using namespace boost::beast;
using namespace std::string_literals;
BOOST_LOG_TRIVIAL(info) << "POST /api/v1/Auth/Logout - Request";
const auto body = req.body();
value req_json;
@@ -44,6 +47,7 @@ public:
}
catch (const system::system_error& err)
{
BOOST_LOG_TRIVIAL(error) << "POST /api/v1/Auth/Logout - Response 500: Cannot deserialize json";
throw session_exception(http::status::internal_server_error, "cannot deserialize json"s);
}
@@ -51,7 +55,8 @@ public:
if (!auth_dao_->Logout(token))
{
throw session_exception(http::status::bad_request, "token is not authorized"s);
BOOST_LOG_TRIVIAL(error) << "POST /api/v1/Auth/Logout - Response 400: Token is not authorized";
throw session_exception(http::status::bad_request, "Token is not authorized"s);
}
http::response<ResponseType> res{http::status::ok, req.version()};