use of com.fsck.k9.mail.store.webdav.WebDavStore in project k-9 by k9mail.
the class WebDavStoreTest method getPersonalNamespaces_shouldSetSpecialFolderNames.
@Test
public void getPersonalNamespaces_shouldSetSpecialFolderNames() throws Exception {
StoreConfig storeConfig = createStoreConfig("webdav://user:password@example.org:80");
WebDavStore webDavStore = new WebDavStore(storeConfig, mockHttpClientFactory);
configureHttpResponses(UNAUTHORIZED_401_RESPONSE, OK_200_RESPONSE, createOkPropfindResponse(), createOkSearchResponse());
webDavStore.getPersonalNamespaces(true);
verify(storeConfig).setInboxFolderName("Inbox");
}
use of com.fsck.k9.mail.store.webdav.WebDavStore in project k-9 by k9mail.
the class WebDavStoreTest method getPersonalNamespaces_shouldRequestFolderList.
@Test
public void getPersonalNamespaces_shouldRequestFolderList() throws Exception {
StoreConfig storeConfig = createStoreConfig("webdav://user:password@example.org:80");
WebDavStore webDavStore = new WebDavStore(storeConfig, mockHttpClientFactory);
configureHttpResponses(UNAUTHORIZED_401_RESPONSE, OK_200_RESPONSE, createOkPropfindResponse(), createOkSearchResponse());
webDavStore.getPersonalNamespaces(true);
List<HttpGeneric> requests = requestCaptor.getAllValues();
// AUTH + SPECIALFOLDERS + 1
assertEquals(4, requests.size());
assertEquals("SEARCH", requests.get(3).getMethod());
}
use of com.fsck.k9.mail.store.webdav.WebDavStore in project k-9 by k9mail.
the class WebDavStoreTest method getFolder_shouldReturnWebDavFolderInstance.
@Test
public void getFolder_shouldReturnWebDavFolderInstance() throws Exception {
WebDavStore webDavStore = createDefaultWebDavStore();
Folder result = webDavStore.getFolder("INBOX");
assertEquals(WebDavFolder.class, result.getClass());
}
use of com.fsck.k9.mail.store.webdav.WebDavStore in project k-9 by k9mail.
the class WebDavStoreTest method constructor_withImapStoreUri_shouldThrow.
@Test(expected = MessagingException.class)
public void constructor_withImapStoreUri_shouldThrow() throws Exception {
StoreConfig storeConfig = createStoreConfig("imap://user:password@imap.example.org");
new WebDavStore(storeConfig, mockHttpClientFactory);
}
Aggregations