Skip to content

Commit

Permalink
Add tests for Patch
Browse files Browse the repository at this point in the history
  • Loading branch information
richardapeters committed Nov 12, 2024
1 parent 3000f0e commit d00b1f5
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions services/network/test/TestHttpClientAuthentication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,26 @@ TEST_F(HttpClientAuthenticationTest, Put_request_is_forwarded_3)
httpClientObserver->Subject().Put("target", infra::MakeRange(headers));
}

TEST_F(HttpClientAuthenticationTest, Patch_request_is_forwarded_1)
{
EXPECT_CALL(httpClient, Patch("target", "contents", testing::_)).WillOnce(testing::Invoke([this](infra::BoundedConstString requestTarget, infra::BoundedConstString contents, services::HttpHeaders headers)
{
CheckHeaders(headers, "header contents");
}));
EXPECT_CALL(clientAuthentication, AuthenticationHeader()).WillOnce(testing::Return("header contents"));
httpClientObserver->Subject().Patch("target", "contents", infra::MakeRange(headers));
}

TEST_F(HttpClientAuthenticationTest, Patch_request_is_forwarded_3)
{
EXPECT_CALL(httpClient, Patch("target", testing::_)).WillOnce(testing::Invoke([this](infra::BoundedConstString requestTarget, services::HttpHeaders headers)
{
CheckHeaders(headers, "header contents");
}));
EXPECT_CALL(clientAuthentication, AuthenticationHeader()).WillOnce(testing::Return("header contents"));
httpClientObserver->Subject().Patch("target", infra::MakeRange(headers));
}

TEST_F(HttpClientAuthenticationTest, Delete_request_is_forwarded)
{
EXPECT_CALL(httpClient, Delete("target", "contents", testing::_)).WillOnce(testing::Invoke([this](infra::BoundedConstString requestTarget, infra::BoundedConstString contents, services::HttpHeaders headers)
Expand Down

0 comments on commit d00b1f5

Please sign in to comment.