From 160f3153cffb110f5b52e244485ccbc2c15b002c Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 20 Sep 2017 10:52:30 +0200 Subject: Fixed tests with secretstore --- examples/imapresource/imapresource.cpp | 9 +++------ examples/imapresource/tests/imapmailsynctest.cpp | 5 +++-- examples/imapresource/tests/imapmailtest.cpp | 3 ++- 3 files changed, 8 insertions(+), 9 deletions(-) (limited to 'examples/imapresource') diff --git a/examples/imapresource/imapresource.cpp b/examples/imapresource/imapresource.cpp index 2aba6b0..b8a741b 100644 --- a/examples/imapresource/imapresource.cpp +++ b/examples/imapresource/imapresource.cpp @@ -841,7 +841,7 @@ protected: auto messageByUid = QSharedPointer>::create(); SinkTrace() << "Connecting to:" << mServer << mPort; SinkTrace() << "as:" << mUser; - auto inspectionJob = imap->login(mUser, mPassword) + auto inspectionJob = imap->login(mUser, secret()) .then(imap->select(folderRemoteId)) .then([](Imap::SelectResult){}) .then(imap->fetch(set, scope, [imap, messageByUid](const Imap::Message &message) { @@ -907,7 +907,7 @@ protected: scope.mode = KIMAP2::FetchJob::FetchScope::Headers; auto imap = QSharedPointer::create(mServer, mPort); auto messageByUid = QSharedPointer>::create(); - return imap->login(mUser, mPassword) + return imap->login(mUser, secret()) .then(imap->select(remoteId)) .then(imap->fetch(set, scope, [=](const Imap::Message message) { messageByUid->insert(message.uid, message); @@ -924,7 +924,7 @@ protected: auto folderByName = QSharedPointer>::create(); auto imap = QSharedPointer::create(mServer, mPort); - auto inspectionJob = imap->login(mUser, mPassword) + auto inspectionJob = imap->login(mUser, secret()) .then(imap->fetchFolders([=](const Imap::Folder &f) { *folderByPath << f.path(); *folderByName << f.name(); @@ -949,7 +949,6 @@ public: QString mServer; int mPort; QString mUser; - QString mPassword; }; @@ -981,8 +980,6 @@ ImapResource::ImapResource(const ResourceContext &resourceContext) inspector->mServer = server; inspector->mPort = port; inspector->mUser = user; - //TODO - // inspector->mPassword = password; setupInspector(inspector); setupPreprocessors(ENTITY_TYPE_MAIL, QVector() << new SpecialPurposeProcessor << new MailPropertyExtractor); diff --git a/examples/imapresource/tests/imapmailsynctest.cpp b/examples/imapresource/tests/imapmailsynctest.cpp index 7cdb103..f20a77e 100644 --- a/examples/imapresource/tests/imapmailsynctest.cpp +++ b/examples/imapresource/tests/imapmailsynctest.cpp @@ -25,6 +25,7 @@ #include "common/test.h" #include "common/domain/applicationdomaintype.h" +#include "common/secretstore.h" using namespace Sink; using namespace Sink::ApplicationDomain; @@ -57,7 +58,7 @@ protected: resource.setProperty("server", "localhost"); resource.setProperty("port", 993); resource.setProperty("username", "doe"); - resource.setProperty("password", "doe"); + Sink::SecretStore::instance().insert(resource.identifier(), "doe"); return resource; } @@ -68,7 +69,7 @@ protected: resource.setProperty("server", "111.111.1.1"); resource.setProperty("port", 993); resource.setProperty("username", "doe"); - resource.setProperty("password", "doe"); + Sink::SecretStore::instance().insert(resource.identifier(), "doe"); return resource; } diff --git a/examples/imapresource/tests/imapmailtest.cpp b/examples/imapresource/tests/imapmailtest.cpp index e6f41f4..60ec1bf 100644 --- a/examples/imapresource/tests/imapmailtest.cpp +++ b/examples/imapresource/tests/imapmailtest.cpp @@ -5,6 +5,7 @@ #include "common/test.h" #include "common/domain/applicationdomaintype.h" +#include "common/secretstore.h" using namespace Sink; using namespace Sink::ApplicationDomain; @@ -37,7 +38,7 @@ protected: resource.setProperty("server", "localhost"); resource.setProperty("port", 993); resource.setProperty("username", "doe"); - resource.setProperty("password", "doe"); + Sink::SecretStore::instance().insert(resource.identifier(), "doe"); return resource; } }; -- cgit v1.2.3