Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHannah von Reth <hannah.vonreth@owncloud.com>2021-01-08 17:31:18 +0300
committerHannah von Reth <vonreth@kde.org>2021-01-09 10:44:40 +0300
commitd3b5651615a8775f699f4cd584bd64853b13a50d (patch)
tree33f3cf4b434dc8eb9d095508b36d8ec1c1cf6d89 /test
parent12bed12732ff7d667e0fc44e0dbea4b6e2e7edfe (diff)
Use the http logger with the unittests
This allow better debugging of the tests
Diffstat (limited to 'test')
-rw-r--r--test/syncenginetestutils.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/test/syncenginetestutils.cpp b/test/syncenginetestutils.cpp
index e940bd517..7bc9f3373 100644
--- a/test/syncenginetestutils.cpp
+++ b/test/syncenginetestutils.cpp
@@ -6,6 +6,8 @@
*/
#include "syncenginetestutils.h"
+#include "httplogger.h"
+#include "accessmanager.h"
PathComponents::PathComponents(const char *path)
@@ -827,27 +829,30 @@ QNetworkReply *FakeQNAM::createRequest(QNetworkAccessManager::Operation op, cons
bool isUpload = request.url().path().startsWith(sUploadUrl.path());
FileInfo &info = isUpload ? _uploadFileInfo : _remoteRootFileInfo;
+ auto newRequest = request;
+ newRequest.setRawHeader("X-Request-ID", OCC::AccessManager::generateRequestId());
auto verb = request.attribute(QNetworkRequest::CustomVerbAttribute);
FakeReply *reply;
if (verb == QLatin1String("PROPFIND"))
// Ignore outgoingData always returning somethign good enough, works for now.
- reply = new FakePropfindReply { info, op, request, this };
+ reply = new FakePropfindReply { info, op, newRequest, this };
else if (verb == QLatin1String("GET") || op == QNetworkAccessManager::GetOperation)
- reply = new FakeGetReply { info, op, request, this };
+ reply = new FakeGetReply { info, op, newRequest, this };
else if (verb == QLatin1String("PUT") || op == QNetworkAccessManager::PutOperation)
- reply = new FakePutReply { info, op, request, outgoingData->readAll(), this };
+ reply = new FakePutReply { info, op, newRequest, outgoingData->readAll(), this };
else if (verb == QLatin1String("MKCOL"))
- reply = new FakeMkcolReply { info, op, request, this };
+ reply = new FakeMkcolReply { info, op, newRequest, this };
else if (verb == QLatin1String("DELETE") || op == QNetworkAccessManager::DeleteOperation)
- reply = new FakeDeleteReply { info, op, request, this };
+ reply = new FakeDeleteReply { info, op, newRequest, this };
else if (verb == QLatin1String("MOVE") && !isUpload)
- reply = new FakeMoveReply { info, op, request, this };
+ reply = new FakeMoveReply { info, op, newRequest, this };
else if (verb == QLatin1String("MOVE") && isUpload)
- reply = new FakeChunkMoveReply { info, _remoteRootFileInfo, op, request, this };
+ reply = new FakeChunkMoveReply { info, _remoteRootFileInfo, op, newRequest, this };
else {
qDebug() << verb << outgoingData;
Q_UNREACHABLE();
}
+ OCC::HttpLogger::logRequest(reply, op, outgoingData);
return reply;
}