mirror of
https://github.com/openappsec/openappsec.git
synced 2025-09-29 19:24:26 +03:00
Jan_31_2024-Dev
This commit is contained in:
@@ -166,11 +166,16 @@ private:
|
||||
bool
|
||||
sendHealthCheckPatch()
|
||||
{
|
||||
dbgFlow(D_HEALTH_CHECK_MANAGER);
|
||||
dbgFlow(D_HEALTH_CHECK_MANAGER) << "Sending a health check patch";
|
||||
|
||||
HealthCheckPatch patch_to_send(general_health_aggregated_status, all_comps_health_status);
|
||||
auto messaging = Singleton::Consume<I_Messaging>::by<HealthCheckManager>();
|
||||
return messaging->sendNoReplyObject(patch_to_send, I_Messaging::Method::PATCH, "/agents");
|
||||
return messaging->sendSyncMessageWithoutResponse(
|
||||
HTTPMethod::PATCH,
|
||||
"/agents",
|
||||
patch_to_send,
|
||||
MessageCategory::GENERIC
|
||||
);
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -4,5 +4,5 @@ link_directories(${BOOST_ROOT}/lib)
|
||||
add_unit_test(
|
||||
health_check_manager_ut
|
||||
"health_check_manager_ut.cc"
|
||||
"singleton;mainloop;health_check_manager;event_is;metric;-lboost_regex"
|
||||
"singleton;messaging;mainloop;health_check_manager;event_is;metric;-lboost_regex"
|
||||
)
|
||||
|
@@ -111,19 +111,18 @@ public:
|
||||
TEST_F(HealthCheckManagerTest, runPeriodicHealthCheckTest)
|
||||
{
|
||||
string actual_body;
|
||||
EXPECT_CALL(
|
||||
mock_message,
|
||||
sendMessage(
|
||||
false,
|
||||
_,
|
||||
I_Messaging::Method::PATCH,
|
||||
"/agents",
|
||||
"",
|
||||
_,
|
||||
_,
|
||||
MessageTypeTag::GENERIC
|
||||
EXPECT_CALL(mock_message, sendSyncMessage(
|
||||
HTTPMethod::PATCH,
|
||||
"/agents",
|
||||
_,
|
||||
_,
|
||||
_
|
||||
)).Times(4).WillRepeatedly(
|
||||
DoAll(
|
||||
SaveArg<2>(&actual_body),
|
||||
Return(HTTPResponse(HTTPStatusCode::HTTP_OK, ""))
|
||||
)
|
||||
).Times(4).WillRepeatedly(DoAll(SaveArg<1>(&actual_body), Return(string())));
|
||||
);
|
||||
|
||||
try {
|
||||
health_check_periodic_routine();
|
||||
|
Reference in New Issue
Block a user