generated from Sithas/conan_template
Подготовка интеграционного теста
This commit is contained in:
@@ -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()};
|
||||
|
||||
Reference in New Issue
Block a user