use of com.fsck.k9.mail.store.StoreConfig in project k-9 by k9mail.
the class WebDavStoreTest method createStoreConfig.
private StoreConfig createStoreConfig(String storeUri) {
StoreConfig storeConfig = mock(StoreConfig.class);
when(storeConfig.getInboxFolderName()).thenReturn("INBOX");
when(storeConfig.getStoreUri()).thenReturn(storeUri);
return storeConfig;
}
use of com.fsck.k9.mail.store.StoreConfig in project k-9 by k9mail.
the class WebDavStoreTest method getPersonalNamespaces_shouldRequestSpecialFolders.
@Test
public void getPersonalNamespaces_shouldRequestSpecialFolders() 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 + 2
assertEquals(4, requests.size());
//Special Folders
assertEquals("PROPFIND", requests.get(2).getMethod());
}
use of com.fsck.k9.mail.store.StoreConfig 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.StoreConfig 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.StoreConfig 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