1 #include "async_resp.hpp"
2 #include "thermal_subsystem.hpp"
3 
4 #include <nlohmann/json.hpp>
5 
6 #include <optional>
7 #include <string>
8 
9 #include <gtest/gtest.h>
10 
11 namespace redfish
12 {
13 namespace
14 {
15 
16 constexpr const char* chassisId = "ChassisId";
17 constexpr const char* validChassisPath = "ChassisPath";
18 
19 void assertThermalCollectionGet(crow::Response& res)
20 {
21     nlohmann::json& json = res.jsonValue;
22     EXPECT_EQ(json["@odata.type"], "#ThermalSubsystem.v1_0_0.ThermalSubsystem");
23     EXPECT_EQ(json["Name"], "Thermal Subsystem");
24     EXPECT_EQ(json["Id"], "ThermalSubsystem");
25     EXPECT_EQ(json["@odata.id"],
26               "/redfish/v1/Chassis/ChassisId/ThermalSubsystem");
27     EXPECT_EQ(json["Status"]["State"], "Enabled");
28     EXPECT_EQ(json["Status"]["Health"], "OK");
29 }
30 
31 TEST(ThermalSubsystemCollectionTest,
32      ThermalSubsystemCollectionStaticAttributesAreExpected)
33 {
34     auto shareAsyncResp = std::make_shared<bmcweb::AsyncResp>();
35     shareAsyncResp->res.setCompleteRequestHandler(assertThermalCollectionGet);
36     doThermalSubsystemCollection(
37         shareAsyncResp, chassisId,
38         std::make_optional<std::string>(validChassisPath));
39 }
40 
41 } // namespace
42 } // namespace redfish
43