summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/caldavresource/tests/caldavtest.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/examples/caldavresource/tests/caldavtest.cpp b/examples/caldavresource/tests/caldavtest.cpp
index 35ab033..4ac1297 100644
--- a/examples/caldavresource/tests/caldavtest.cpp
+++ b/examples/caldavresource/tests/caldavtest.cpp
@@ -28,12 +28,16 @@ class CalDavTest : public QObject
28{ 28{
29 Q_OBJECT 29 Q_OBJECT
30 30
31 const QString baseUrl = "http://localhost/dav/calendars/users/doe";
32 const QString username = "doe";
33 const QString password = "doe";
34
31 SinkResource createResource() 35 SinkResource createResource()
32 { 36 {
33 auto resource = Sink::ApplicationDomain::CalDavResource::create("account1"); 37 auto resource = Sink::ApplicationDomain::CalDavResource::create("account1");
34 resource.setProperty("server", "http://localhost:5232"); 38 resource.setProperty("server", baseUrl);
35 resource.setProperty("username", "test1"); 39 resource.setProperty("username", username);
36 Sink::SecretStore::instance().insert(resource.identifier(), "test1"); 40 Sink::SecretStore::instance().insert(resource.identifier(), password);
37 resource.setProperty("testmode", true); 41 resource.setProperty("testmode", true);
38 return resource; 42 return resource;
39 } 43 }
@@ -175,8 +179,11 @@ private slots:
175 // Change the item without sink's knowledge 179 // Change the item without sink's knowledge
176 { 180 {
177 qWarning() << 1; 181 qWarning() << 1;
178 auto collection = ([]() -> KDAV2::DavCollection { 182 auto collection = ([this]() -> KDAV2::DavCollection {
179 KDAV2::DavUrl davurl({ "http://test1:test1@localhost:5232" }, KDAV2::CalDav); 183 QUrl url(baseUrl);
184 url.setUserName(username);
185 url.setPassword(password);
186 KDAV2::DavUrl davurl(url, KDAV2::CalDav);
180 KDAV2::DavCollectionsFetchJob collectionsJob(davurl); 187 KDAV2::DavCollectionsFetchJob collectionsJob(davurl);
181 collectionsJob.exec(); 188 collectionsJob.exec();
182 Q_ASSERT(collectionsJob.error() == 0); 189 Q_ASSERT(collectionsJob.error() == 0);