From d9d3fcbf8cf905d6ff7e391fcb4da854af91f018 Mon Sep 17 00:00:00 2001 From: Hannah von Reth Date: Tue, 16 Jan 2024 10:18:07 +0100 Subject: [PATCH] FakeErrorReply: Add support for 401 --- test/testutils/syncenginetestutils.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/testutils/syncenginetestutils.cpp b/test/testutils/syncenginetestutils.cpp index c16415f9a88..fd1e36f05cc 100644 --- a/test/testutils/syncenginetestutils.cpp +++ b/test/testutils/syncenginetestutils.cpp @@ -818,7 +818,11 @@ FakeErrorReply::FakeErrorReply(QNetworkAccessManager::Operation op, const QNetwo setOperation(op); open(QIODevice::ReadOnly); setAttribute(QNetworkRequest::HttpStatusCodeAttribute, httpErrorCode); - setError(InternalServerError, QStringLiteral("Internal Server Fake Error")); + if (httpErrorCode == 401) { + setError(AuthenticationRequiredError, QStringLiteral("Fake credentials error")); + } else { + setError(InternalServerError, QStringLiteral("Internal Server Fake Error")); + } QMetaObject::invokeMethod(this, &FakeErrorReply::respond, Qt::QueuedConnection); }