Skip to content

v0.2.53..v0.2.54 changeset OsmApiWriterTestServer.h

Garret Voltz edited this page Mar 31, 2020 · 1 revision
diff --git a/hoot-core-test/src/test/cpp/hoot/core/io/OsmApiWriterTestServer.h b/hoot-core-test/src/test/cpp/hoot/core/io/OsmApiWriterTestServer.h
index b97e770..19c7deb 100644
--- a/hoot-core-test/src/test/cpp/hoot/core/io/OsmApiWriterTestServer.h
+++ b/hoot-core-test/src/test/cpp/hoot/core/io/OsmApiWriterTestServer.h
@@ -22,7 +22,7 @@
  * This will properly maintain the copyright information. DigitalGlobe
  * copyrights will be updated automatically.
  *
- * @copyright Copyright (C) 2019 DigitalGlobe (http://www.digitalglobe.com/)
+ * @copyright Copyright (C) 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/)
  */
 
 #ifndef OSM_API_WRITER_TEST_SERVER_H
@@ -99,6 +99,26 @@ private:
   bool _has_error;
 };
 
+class ChangesetOutputTestServer : public HttpTestServer
+{
+public:
+  /** Constructor */
+  ChangesetOutputTestServer(int port) : HttpTestServer(port) { }
+
+protected:
+  /** respond() function that responds to a series of OSM API requests
+   *  to simulate a
+   *  Requests, in order:
+   *   - Capabilities
+   *   - Permissions
+   *   - Changeset Create
+   *   - Changeset Upload - responds with HTTP 200
+   *   - Changeset Upload - responds with HTTP 200
+   *   - Changeset Close
+   */
+  virtual bool respond(HttpConnection::HttpConnectionPtr& connection) override;
+};
+
 class OsmApiSampleRequestResponse
 {
 public:
@@ -118,6 +138,9 @@ public:
   static const char* SAMPLE_CHANGESET_1_RESPONSE;
   /** Sample element GET response from '/api/0.6/way/1' */
   static const char* SAMPLE_ELEMENT_1_GET_RESPONSE;
+  /** Sample Changeset upload response bodies from '/api/0.6/changeset/1/upload' divided into two responses */
+  static const char* SAMPLE_CHANGESET_SUCCESS_1_RESPONSE;
+  static const char* SAMPLE_CHANGESET_SUCCESS_2_RESPONSE;
 };
 
 }
Clone this wiki locally