diff OrthancFramework/UnitTestsSources/RestApiTests.cpp @ 4330:a01b1c9cbef4

moving generic type definitions from IHttpHandler to HttpToolbox
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 25 Nov 2020 14:39:10 +0100
parents 9684a690ca63
children 072adf3c3409
line wrap: on
line diff
--- a/OrthancFramework/UnitTestsSources/RestApiTests.cpp	Wed Nov 25 13:46:49 2020 +0100
+++ b/OrthancFramework/UnitTestsSources/RestApiTests.cpp	Wed Nov 25 14:39:10 2020 +0100
@@ -33,7 +33,6 @@
 #include "../Sources/HttpServer/MultipartStreamReader.h"
 #include "../Sources/Logging.h"
 #include "../Sources/OrthancException.h"
-#include "../Sources/RestApi/RestApi.h"
 #include "../Sources/RestApi/RestApiHierarchy.h"
 #include "../Sources/WebServiceParameters.h"
 
@@ -41,6 +40,10 @@
 #include <boost/lexical_cast.hpp>
 #include <algorithm>
 
+#if ORTHANC_SANDBOXED != 1
+#  include "../Sources/RestApi/RestApi.h"
+#endif
+
 
 using namespace Orthanc;
 
@@ -182,8 +185,8 @@
 #if ORTHANC_SANDBOXED != 1
 TEST(RestApi, ParseCookies)
 {
-  IHttpHandler::Arguments headers;
-  IHttpHandler::Arguments cookies;
+  HttpToolbox::Arguments headers;
+  HttpToolbox::Arguments cookies;
 
   headers["cookie"] = "a=b;c=d;;;e=f;;g=h;";
   HttpToolbox::ParseCookies(cookies, headers);
@@ -213,7 +216,7 @@
 
 TEST(RestApi, RestApiPath)
 {
-  IHttpHandler::Arguments args;
+  HttpToolbox::Arguments args;
   UriComponents trail;
 
   {
@@ -311,7 +314,7 @@
   public:
     virtual bool Visit(const RestApiHierarchy::Resource& resource,
                        const UriComponents& uri,
-                       const IHttpHandler::Arguments& components,
+                       const HttpToolbox::Arguments& components,
                        const UriComponents& trailing) ORTHANC_OVERRIDE
     {
       return resource.Handle(*(RestApiGetCall*) NULL);
@@ -979,6 +982,7 @@
 
 #if ORTHANC_SANDBOXED != 1
 
+
 namespace
 {
   class TotoBody : public HttpClient::IRequestBody
@@ -1034,7 +1038,7 @@
                                             const char* username,
                                             HttpMethod method,
                                             const UriComponents& uri,
-                                            const Arguments& headers) ORTHANC_OVERRIDE
+                                            const HttpToolbox::Arguments& headers) ORTHANC_OVERRIDE
     {
       return false;
     }
@@ -1045,8 +1049,8 @@
                         const char* username,
                         HttpMethod method,
                         const UriComponents& uri,
-                        const Arguments& headers,
-                        const GetArguments& getArguments,
+                        const HttpToolbox::Arguments& headers,
+                        const HttpToolbox::GetArguments& getArguments,
                         const void* bodyData,
                         size_t bodySize) ORTHANC_OVERRIDE
     {