9 #include <gmock/gmock.h>
10 #include <gtest/gtest.h>
14 using namespace testing;
17 using Json = nlohmann::json;
20 TEST(TestParseReceivers, EmptyReceiverList) {
21 using namespace nlohmann;
30 TEST(TestParseReceivers, ValidReceiverList) {
31 using namespace nlohmann;
35 "type": "olasReceiver",
37 "path": "/path/to/incoming"
43 ASSERT_TRUE(std::holds_alternative<OlasReceiver>(l[0]));
44 auto const& r = std::get<OlasReceiver>(l[0]);
49 TEST(TestParseOlasReceiver, ValidOlasReceiverWithoutHost) {
50 using namespace nlohmann;
53 "type": "olasReceiver",
54 "path": "/path/to/incoming"
62 TEST(TestParseOlasReceiver, ValidOlasReceiverWithOptions) {
63 using namespace nlohmann;
66 "type": "olasReceiver",
67 "path": "/path/to/incoming",
80 TEST(TestParseOlasReceiver, MissingPathIsRejected) {
81 using namespace nlohmann;
84 "type": "olasReceiver",
91 TEST(TestParseOlasReceiver, RelativePathsShouldBeRejected) {
92 using namespace nlohmann;
95 "type": "olasReceiver",
96 "path": "relative/path/to/incoming"
103 using namespace nlohmann;
107 "type": "olasReceiver",
109 "path": "/path/to/incoming/",
std::filesystem::path path
Absolute path to the OLAS "incoming directory" where DPM will drop files.
OlasReceiver ParseOlasReceiver(nlohmann::json const &json, nlohmann::json_pointer< nlohmann::json > const &breadcrumb)
nlohmann::json_pointer< Json > JsonPointer
std::vector< ReceiverTypes > ReceiverList
ReceiverTransferOptions options
ReceiverList ParseReceiverList(Json const &json, JsonPointer const &breadcrumb)
std::string host
DHS host where OLAS ingest files.
daq::json::TestParseStartDaqV2Spec _json
TEST(TestRoundTripParsing, ReceiverList)
Represents OlasReceiver JSON type used in StartDaqV2 and dpspec.
void to_json(nlohmann::json &j, Status const &p)
EXPECT_EQ(meta.rr_uri, "zpb.rr://meta")
ASSERT_EQ(meta.keyword_rules.size(), 1u)
ASSERT_TRUE(std::holds_alternative< OlasReceiver >(spec.receivers[0]))