Skip to content

Commit

Permalink
style: clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyTWF committed Apr 14, 2024
1 parent 1e82d32 commit cd0e20e
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions test/utils/log/ApiLoggerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ namespace UKControllerPluginUtilsTest::Api {

TEST_F(ApiLoggerTest, ItLogsSync)
{
const nlohmann::json expectedPayload = {{"type", "type"}, {"message", "message"}, {"plugin_version", "#VERSION_STRING#"}};
const nlohmann::json expectedPayload = {
{"type", "type"}, {"message", "message"}, {"plugin_version", "#VERSION_STRING#"}};

this->ExpectApiRequest()->Post().To("plugin/logs").WithBody(expectedPayload).WillReturnCreated();
logger.Log("type", "message");
Expand All @@ -24,15 +25,19 @@ namespace UKControllerPluginUtilsTest::Api {
{
const nlohmann::json metadata = {{"key", "value"}};
const nlohmann::json expectedPayload = {
{"type", "type"}, {"message", "message"}, {"metadata", metadata.dump()}, {"plugin_version", "#VERSION_STRING#"}};
{"type", "type"},
{"message", "message"},
{"metadata", metadata.dump()},
{"plugin_version", "#VERSION_STRING#"}};

this->ExpectApiRequest()->Post().To("plugin/logs").WithBody(expectedPayload).WillReturnCreated();
logger.Log("type", "message", metadata);
}

TEST_F(ApiLoggerTest, ItLogsAsync)
{
const nlohmann::json expectedPayload = {{"type", "type"}, {"message", "message"}, {"plugin_version", "#VERSION_STRING#"}};
const nlohmann::json expectedPayload = {
{"type", "type"}, {"message", "message"}, {"plugin_version", "#VERSION_STRING#"}};

this->ExpectApiRequest()->Post().To("plugin/logs").WithBody(expectedPayload).WillReturnCreated();
logger.LogAsync("type", "message");
Expand All @@ -42,7 +47,10 @@ namespace UKControllerPluginUtilsTest::Api {
{
const nlohmann::json metadata = {{"key", "value"}};
const nlohmann::json expectedPayload = {
{"type", "type"}, {"message", "message"}, {"metadata", metadata.dump()}, {"plugin_version", "#VERSION_STRING#"}};
{"type", "type"},
{"message", "message"},
{"metadata", metadata.dump()},
{"plugin_version", "#VERSION_STRING#"}};

this->ExpectApiRequest()->Post().To("plugin/logs").WithBody(expectedPayload).WillReturnCreated();
logger.LogAsync("type", "message", metadata);
Expand Down

0 comments on commit cd0e20e

Please sign in to comment.