summaryrefslogtreecommitdiff
path: root/icespider/unittests
diff options
context:
space:
mode:
Diffstat (limited to 'icespider/unittests')
-rw-r--r--icespider/unittests/test-api.ice2
-rw-r--r--icespider/unittests/testApp.cpp11
-rw-r--r--icespider/unittests/testRoutes.json3
3 files changed, 9 insertions, 7 deletions
diff --git a/icespider/unittests/test-api.ice b/icespider/unittests/test-api.ice
index 4fc87bd..ff43dc2 100644
--- a/icespider/unittests/test-api.ice
+++ b/icespider/unittests/test-api.ice
@@ -7,7 +7,7 @@ module TestIceSpider {
SomeModel index();
SomeModel withParams(string s, int i);
void returnNothing(string s);
- void complexParam(string s, SomeModel m);
+ void complexParam(optional(0) string s, SomeModel m);
};
};
diff --git a/icespider/unittests/testApp.cpp b/icespider/unittests/testApp.cpp
index aa00c43..e91f618 100644
--- a/icespider/unittests/testApp.cpp
+++ b/icespider/unittests/testApp.cpp
@@ -55,17 +55,17 @@ class TestRequest : public IceSpider::IHttpRequest {
return method;
}
- std::string getURLParam(const std::string & key) const override
+ IceUtil::Optional<std::string> getURLParam(const std::string & key) const override
{
return AdHoc::safeMapLookup<std::runtime_error>(url, key);
}
- std::string getQueryStringParam(const std::string & key) const override
+ IceUtil::Optional<std::string> getQueryStringParam(const std::string & key) const override
{
return AdHoc::safeMapLookup<std::runtime_error>(qs, key);
}
- std::string getHeaderParam(const std::string & key) const override
+ IceUtil::Optional<std::string> getHeaderParam(const std::string & key) const override
{
return AdHoc::safeMapLookup<std::runtime_error>(hdr, key);
}
@@ -140,9 +140,10 @@ class TestSerice : public TestIceSpider::TestApi {
BOOST_REQUIRE_EQUAL(s, "some value");
}
- void complexParam(const std::string & s, const TestIceSpider::SomeModelPtr & m, const Ice::Current &) override
+ void complexParam(const IceUtil::Optional<std::string> & s, const TestIceSpider::SomeModelPtr & m, const Ice::Current &) override
{
- BOOST_REQUIRE_EQUAL(s, "1234");
+ BOOST_REQUIRE(s);
+ BOOST_REQUIRE_EQUAL("1234", *s);
BOOST_REQUIRE(m);
BOOST_REQUIRE_EQUAL("some value", m->value);
}
diff --git a/icespider/unittests/testRoutes.json b/icespider/unittests/testRoutes.json
index 2b7b48d..b766f31 100644
--- a/icespider/unittests/testRoutes.json
+++ b/icespider/unittests/testRoutes.json
@@ -28,7 +28,8 @@
{
"name": "s",
"source": "URL",
- "key": "id"
+ "key": "id",
+ "isOptional": true
},
{
"name": "m",