Skip to content

Commit

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

TEST_F(ApiLoggerTest, ItLogsSync)
{
const nlohmann::json expectedPayload = {{"type", "type"}, {"message", "message"}};
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 +24,15 @@ namespace UKControllerPluginUtilsTest::Api {
{
const nlohmann::json metadata = {{"key", "value"}};
const nlohmann::json expectedPayload = {
{"type", "type"}, {"message", "message"}, {"metadata", metadata.dump()}};
{"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"}};
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 +42,7 @@ namespace UKControllerPluginUtilsTest::Api {
{
const nlohmann::json metadata = {{"key", "value"}};
const nlohmann::json expectedPayload = {
{"type", "type"}, {"message", "message"}, {"metadata", metadata.dump()}};
{"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 1e82d32

Please sign in to comment.