userver
C++ Async Framework
Loading...
Searching...
No Matches
samples/testsuite-support/src/testpoint.cpp
#include "
testpoint.hpp
"
#include <
userver/testsuite/testpoint.hpp
>
namespace
tests::handlers {
formats::json::Value
Testpoint::HandleRequestJsonThrow(
[[maybe_unused]]
const
server::http::HttpRequest
& request,
[[maybe_unused]]
const
formats::json::Value
& request_body,
[[maybe_unused]]
server::request::RequestContext
& context)
const
{
TESTPOINT
(
"simple-testpoint"
, [] {
formats::json::ValueBuilder
builder;
builder[
"payload"
] =
"Hello, world!"
;
return
builder.
ExtractValue
();
}());
formats::json::ValueBuilder
result;
TESTPOINT_CALLBACK
(
"injection-point"
,
formats::json::Value
(),
[&result](
const
formats::json::Value
& doc) {
result[
"value"
] = doc[
"value"
].
As
<std::string>(
""
);
});
return
result.
ExtractValue
();
}
}
// namespace tests::handlers
Generated on Wed May 15 2024 22:13:58 for userver by
Doxygen
1.10.0