mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
handle empty host
This commit is contained in:
parent
9f1809624b
commit
593f8eab83
@ -36,6 +36,10 @@ JsonRequestReturn JsonRequest::request(const char* methodName, const Poco::JSON:
|
||||
// send post request via https
|
||||
// 443 = HTTPS Default
|
||||
// TODO: adding port into ServerConfig
|
||||
if (mServerHost.empty() || !mServerPort) {
|
||||
addError(new Error(functionName, "server host or server port not given"));
|
||||
return JSON_REQUEST_PARAMETER_ERROR;
|
||||
}
|
||||
try {
|
||||
Profiler phpRequestTime;
|
||||
|
||||
|
||||
@ -20,6 +20,7 @@ enum JsonRequestReturn
|
||||
JSON_REQUEST_RETURN_OK,
|
||||
JSON_REQUEST_RETURN_PARSE_ERROR,
|
||||
JSON_REQUEST_RETURN_ERROR,
|
||||
JSON_REQUEST_PARAMETER_ERROR,
|
||||
JSON_REQUEST_CONNECT_ERROR
|
||||
};
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@ void TestJsonCreateTransaction::SetUp()
|
||||
mUserSession = sm->getNewSession();
|
||||
auto user = controller::User::create();
|
||||
user->load("Jeet_bb@gmail.com");
|
||||
user->login("TestP4ssword&H");
|
||||
mUserSession->setUser(user);
|
||||
}
|
||||
|
||||
@ -25,7 +26,10 @@ Poco::JSON::Object::Ptr TestJsonCreateTransaction::basisSetup()
|
||||
{
|
||||
Poco::JSON::Object::Ptr params = new Poco::JSON::Object;
|
||||
params->set("session_id", mUserSession->getHandle());
|
||||
|
||||
params->set("blockchain_type", "mysql");
|
||||
params->set("memo", "Placolder for memo for test");
|
||||
params->set("auto_sign", true);
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
@ -35,6 +39,13 @@ TEST_F(TestJsonCreateTransaction, Creation)
|
||||
|
||||
auto params = basisSetup();
|
||||
params->set("transaction_type", "creation");
|
||||
params->set("target_email", "Elfenhausen@arcor.de");
|
||||
params->set("amount", 10000000);
|
||||
params->set("target_date", "2021-07-13T13:00:00");
|
||||
|
||||
auto result = jsonCall.handle(params);
|
||||
std::stringstream ss;
|
||||
result->stringify(ss);
|
||||
printf("result: %s\n", ss.str().data());
|
||||
//*/
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user