| #include "async_resp.hpp" |
| #include "http_response.hpp" |
| #include "nlohmann/json.hpp" |
| #include "redfish-core/lib/redfish_sessions.hpp" |
| #include "snapshot_fixture.hpp" |
| |
| #include <memory> |
| |
| #include <gmock/gmock.h> |
| #include <gtest/gtest.h> |
| |
| namespace redfish |
| { |
| namespace |
| { |
| |
| TEST_F(SnapshotFixture, SessionCollectionOdataIdHasNoTrailingSlash) |
| { |
| handleSessionCollectionGet(app_, CreateRequest(), share_async_resp_); |
| RunIoUntilDone(); |
| EXPECT_EQ(share_async_resp_->res.jsonValue["@odata.id"], |
| "/redfish/v1/SessionService/Sessions"); |
| EXPECT_EQ(share_async_resp_->res.jsonValue["@odata.type"], |
| "#SessionCollection.SessionCollection"); |
| EXPECT_EQ(share_async_resp_->res.jsonValue["Description"], |
| "Session Collection"); |
| EXPECT_EQ(share_async_resp_->res.jsonValue["Name"], "Session Collection"); |
| } |
| |
| TEST_F(SnapshotFixture, SessionServiceOdataIdHasNoTrailingSlash) |
| { |
| handleSessionServiceGet(app_, CreateRequest(), share_async_resp_); |
| RunIoUntilDone(); |
| EXPECT_EQ(share_async_resp_->res.jsonValue["@odata.id"], |
| "/redfish/v1/SessionService"); |
| EXPECT_EQ(share_async_resp_->res.jsonValue["@odata.type"], |
| "#SessionService.v1_0_2.SessionService"); |
| EXPECT_EQ(share_async_resp_->res.jsonValue["Id"], "SessionService"); |
| EXPECT_EQ(share_async_resp_->res.jsonValue["Description"], |
| "Session Service"); |
| EXPECT_EQ(share_async_resp_->res.jsonValue["Name"], "Session Service"); |
| EXPECT_EQ(share_async_resp_->res.jsonValue["ServiceEnabled"], true); |
| EXPECT_EQ(share_async_resp_->res.jsonValue["Sessions"]["@odata.id"], |
| "/redfish/v1/SessionService/Sessions"); |
| } |
| |
| } // namespace |
| } // namespace redfish |