diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/redfish-core/include/redfish_aggregator_test.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/test/redfish-core/include/redfish_aggregator_test.cpp b/test/redfish-core/include/redfish_aggregator_test.cpp index 83e4b4ec23..26015f7096 100644 --- a/test/redfish-core/include/redfish_aggregator_test.cpp +++ b/test/redfish-core/include/redfish_aggregator_test.cpp @@ -248,8 +248,8 @@ void assertProcessResponse(unsigned result) jsonResp["Name"] = "Test"; crow::Response resp; - resp.body() = jsonResp.dump(2, ' ', true, - nlohmann::json::error_handler_t::replace); + resp.write( + jsonResp.dump(2, ' ', true, nlohmann::json::error_handler_t::replace)); resp.addHeader("Content-Type", "application/json"); resp.addHeader("Allow", "GET"); resp.addHeader("Location", "/redfish/v1/Chassis/TestChassis"); @@ -351,8 +351,8 @@ void populateCollectionNotFound(crow::Response& resp) // from a satellite which will not have a json component void convertToSat(crow::Response& resp) { - resp.body() = resp.jsonValue.dump(2, ' ', true, - nlohmann::json::error_handler_t::replace); + resp.write(resp.jsonValue.dump(2, ' ', true, + nlohmann::json::error_handler_t::replace)); resp.jsonValue.clear(); } @@ -494,7 +494,7 @@ TEST(processCollectionResponse, preserveHeaders) void assertProcessResponseContentType(std::string_view contentType) { crow::Response resp; - resp.body() = "responseBody"; + resp.write("responseBody"); resp.addHeader("Content-Type", contentType); resp.addHeader("Location", "/redfish/v1/Chassis/TestChassis"); resp.addHeader("Link", "metadataLink"); @@ -507,7 +507,7 @@ void assertProcessResponseContentType(std::string_view contentType) "/redfish/v1/Chassis/prefix_TestChassis"); EXPECT_EQ(asyncResp->res.getHeaderValue("Link"), ""); EXPECT_EQ(asyncResp->res.getHeaderValue("Retry-After"), "120"); - EXPECT_EQ(asyncResp->res.body(), "responseBody"); + EXPECT_EQ(*asyncResp->res.body(), "responseBody"); } TEST(processResponse, DifferentContentType) @@ -658,8 +658,8 @@ TEST(processContainsSubordinateResponse, addLinks) jsonValue["Test"]["@odata.id"] = "/redfish/v1/Test"; jsonValue["TelemetryService"]["@odata.id"] = "/redfish/v1/TelemetryService"; jsonValue["UpdateService"]["@odata.id"] = "/redfish/v1/UpdateService"; - resp.body() = jsonValue.dump(2, ' ', true, - nlohmann::json::error_handler_t::replace); + resp.write( + jsonValue.dump(2, ' ', true, nlohmann::json::error_handler_t::replace)); auto asyncResp = std::make_shared<bmcweb::AsyncResp>(); asyncResp->res.result(200); @@ -701,8 +701,8 @@ TEST(processContainsSubordinateResponse, localNotOK) jsonValue["Test"]["@odata.id"] = "/redfish/v1/Test"; jsonValue["TelemetryService"]["@odata.id"] = "/redfish/v1/TelemetryService"; jsonValue["UpdateService"]["@odata.id"] = "/redfish/v1/UpdateService"; - resp.body() = jsonValue.dump(2, ' ', true, - nlohmann::json::error_handler_t::replace); + resp.write( + jsonValue.dump(2, ' ', true, nlohmann::json::error_handler_t::replace)); RedfishAggregator::processContainsSubordinateResponse("prefix", asyncResp, resp); @@ -769,8 +769,8 @@ TEST(processContainsSubordinateResponse, noValidLinks) nlohmann::json jsonValue; resp.addHeader("Content-Type", "application/json"); jsonValue["@odata.id"] = "/redfish/v1"; - resp.body() = jsonValue.dump(2, ' ', true, - nlohmann::json::error_handler_t::replace); + resp.write( + jsonValue.dump(2, ' ', true, nlohmann::json::error_handler_t::replace)); RedfishAggregator::processContainsSubordinateResponse("prefix", asyncResp, resp); @@ -788,8 +788,8 @@ TEST(processContainsSubordinateResponse, noValidLinks) jsonValue["Test"]["@odata.id"] = "/redfish/v1/Test"; jsonValue["TelemetryService"]["@odata.id"] = "/redfish/v1/TelemetryService"; jsonValue["UpdateService"]["@odata.id"] = "/redfish/v1/UpdateService"; - resp.body() = jsonValue.dump(2, ' ', true, - nlohmann::json::error_handler_t::replace); + resp.write( + jsonValue.dump(2, ' ', true, nlohmann::json::error_handler_t::replace)); RedfishAggregator::processContainsSubordinateResponse("prefix", asyncResp, resp); |