Commit 54100b18 authored by Patrick Chen's avatar Patrick Chen

use 'param' as attribute name in script

parent 5001e7da
......@@ -11,7 +11,7 @@
"script": [
{
"command": "GetMessage",
"params": {},
"param": {},
"expect": {
"response": "Hello, Master!",
"runs": ["GetName"],
......
......@@ -25,7 +25,7 @@ namespace xs { namespace test
public:
std::string name_;
nlohmann::json params_;
nlohmann::json request_;
nlohmann::json response_;
std::unordered_set<std::string> runs_;
std::unordered_set<std::string> posts_;
......
......@@ -9,7 +9,7 @@ namespace xs { namespace test
Expectation::Expectation(const nlohmann::json& object)
: name_(object["command"].get<std::string>())
{
params_ = object["params"];
request_ = object["param"];
const auto& expect = object["expect"];
response_ = expect["response"];
......@@ -43,11 +43,11 @@ namespace xs { namespace test
return false;
}
if (!object.count("params")) {
if (!object.count("param")) {
return false;
}
if (!(object["params"].is_string() || object["params"].is_object())) {
if (!(object["param"].is_string() || object["param"].is_object())) {
return false;
}
......
......@@ -134,7 +134,7 @@ void Tester::run() noexcept
for (const auto& expectation : config_.getExpectations()) {
resetCounters();
const auto response = server_.runCmd(expectation.name_, expectation.params_.dump());
const auto response = server_.runCmd(expectation.name_, expectation.request_.dump());
// wait 100ms for upcoming events
using namespace std::chrono_literals;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment