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); }