mirror of
https://github.com/openappsec/openappsec.git
synced 2025-09-29 11:16:30 +03:00
Jul 5th update
This commit is contained in:
@@ -99,6 +99,8 @@ TEST_F(RestConfigTest, alternative_port_used)
|
||||
);
|
||||
mainloop->run();
|
||||
|
||||
EXPECT_EQ(Singleton::Consume<I_RestApi>::from(rest_server)->getListeningPort(), *alternative_port);
|
||||
|
||||
sa.sin_port = htons(alternative_port.unpack());
|
||||
EXPECT_EQ(bind(file_descriptor, reinterpret_cast<struct sockaddr *>(&sa), sizeof(struct sockaddr_in)), -1);
|
||||
|
||||
|
@@ -19,6 +19,7 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <sstream>
|
||||
#include "customized_cereal_map.h"
|
||||
#include "customized_cereal_multimap.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -175,6 +176,14 @@ class MustMapInt : public ServerRest
|
||||
C2S_PARAM(mapStringInt, must_map_int);
|
||||
};
|
||||
|
||||
class MustMultiMap : public ServerRest
|
||||
{
|
||||
void doCall() override {}
|
||||
|
||||
using mapStringInt = SerializableMultiMap<string, int>;
|
||||
C2S_PARAM(mapStringInt, must_multimap);
|
||||
};
|
||||
|
||||
TEST(RestSchema, must_map)
|
||||
{
|
||||
stringstream string_map_schema;
|
||||
@@ -214,6 +223,32 @@ TEST(RestSchema, must_map)
|
||||
" ]\n"
|
||||
"}"
|
||||
);
|
||||
|
||||
stringstream multi_map_schema;
|
||||
MustMultiMap().performOutputingSchema(multi_map_schema);
|
||||
EXPECT_EQ(
|
||||
multi_map_schema.str(),
|
||||
"{\n"
|
||||
" \"properties\": {\n"
|
||||
" \"must_multimap\": {\n"
|
||||
" \"type\": \"object\",\n"
|
||||
" \"additionalProperties\": {\n"
|
||||
" \"anyOf\": [\n"
|
||||
" {\n"
|
||||
" \"type\": \"string\"\n"
|
||||
" },\n"
|
||||
" {\n"
|
||||
" \"type\": \"integer\"\n"
|
||||
" }\n"
|
||||
" ]\n"
|
||||
" }\n"
|
||||
" }\n"
|
||||
" },\n"
|
||||
" \"required\": [\n"
|
||||
" \"must_multimap\"\n"
|
||||
" ]\n"
|
||||
"}"
|
||||
);
|
||||
}
|
||||
|
||||
class MustObject : public ServerRest
|
||||
|
Reference in New Issue
Block a user