@Test public void checkSettings_withOkResponse_shouldPerformFormBasedAuthentication() throws Exception { WebDavStore webDavStore = createDefaultWebDavStore(); ArgumentCaptor<HttpGeneric> requestCaptor = ArgumentCaptor.forClass(HttpGeneric.class); when(mockHttpClient.executeOverride(requestCaptor.capture(), any(HttpContext.class))) .thenReturn(OK_200_RESPONSE) .thenReturn(createOkResponseWithForm()) .thenAnswer(createOkResponseWithCookie()) .thenReturn(OK_200_RESPONSE); webDavStore.checkSettings(); List<HttpGeneric> requests = requestCaptor.getAllValues(); assertEquals(4, requests.size()); assertEquals("GET", requests.get(0).getMethod()); assertEquals("POST", requests.get(1).getMethod()); assertEquals("http: assertEquals("POST", requests.get(2).getMethod()); assertEquals("http: assertEquals("GET", requests.get(3).getMethod()); }
@Override public void checkSettings() throws MessagingException { authenticate(); }
WebDavStore extends RemoteStore { @Override public void checkSettings() throws MessagingException { authenticate(); } }
WebDavStore extends RemoteStore { @Override public void checkSettings() throws MessagingException { authenticate(); } WebDavStore(StoreConfig storeConfig, QMailHttpClientFactory clientFactory); }
WebDavStore extends RemoteStore { @Override public void checkSettings() throws MessagingException { authenticate(); } WebDavStore(StoreConfig storeConfig, QMailHttpClientFactory clientFactory); static WebDavStoreSettings decodeUri(String uri); static String createUri(ServerSettings server); @Override void checkSettings(); @Override @NonNull List<? extends Folder> getFolders(boolean forceListAll); @NonNull @Override List<? extends Folder> getSubFolders(String parentFolderId, boolean forceListAll); @Override @NonNull WebDavFolder getFolder(String name); @Override boolean isMoveCapable(); @Override boolean isCopyCapable(); CookieStore getAuthCookies(); String getAlias(); String getUrl(); QMailHttpClient getHttpClient(); String getAuthString(); @Override boolean isSendCapable(); @Override void sendMessages(List<? extends Message> messages); }
WebDavStore extends RemoteStore { @Override public void checkSettings() throws MessagingException { authenticate(); } WebDavStore(StoreConfig storeConfig, QMailHttpClientFactory clientFactory); static WebDavStoreSettings decodeUri(String uri); static String createUri(ServerSettings server); @Override void checkSettings(); @Override @NonNull List<? extends Folder> getFolders(boolean forceListAll); @NonNull @Override List<? extends Folder> getSubFolders(String parentFolderId, boolean forceListAll); @Override @NonNull WebDavFolder getFolder(String name); @Override boolean isMoveCapable(); @Override boolean isCopyCapable(); CookieStore getAuthCookies(); String getAlias(); String getUrl(); QMailHttpClient getHttpClient(); String getAuthString(); @Override boolean isSendCapable(); @Override void sendMessages(List<? extends Message> messages);  }