@Test public void resendAsynchronouslySeveralMessagesWhenMailResendingFailed() throws Exception { Map filterMap = Collections.singletonMap("state", "prepare_%"); MailResender resender = this.mocker.getInstance(MailResender.class, "database"); when(resender.resendAsynchronously(filterMap, 5, 10)).thenThrow(new MailStoreException("error")); List<ScriptMailResult> scriptResults = this.mocker.getComponentUnderTest().resendAsynchronously(filterMap, 5, 10); assertNull(scriptResults); assertEquals("error", this.mocker.getComponentUnderTest().getLastError().getMessage()); }
public ScriptMailResult resendAsynchronously(String batchId, String uniqueMessageId) { try { MailStatusResult statusResult = this.mailResender.resendAsynchronously(batchId, uniqueMessageId); ScriptMailResult scriptMailResult = new ScriptMailResult(new DefaultMailResult(batchId), statusResult); return scriptMailResult; } catch (MailStoreException e) { setError(e); return null; } }
DeprecatedMailStorageScriptService extends AbstractMailScriptService { public ScriptMailResult resendAsynchronously(String batchId, String uniqueMessageId) { try { MailStatusResult statusResult = this.mailResender.resendAsynchronously(batchId, uniqueMessageId); ScriptMailResult scriptMailResult = new ScriptMailResult(new DefaultMailResult(batchId), statusResult); return scriptMailResult; } catch (MailStoreException e) { setError(e); return null; } } }
DeprecatedMailStorageScriptService extends AbstractMailScriptService { public ScriptMailResult resendAsynchronously(String batchId, String uniqueMessageId) { try { MailStatusResult statusResult = this.mailResender.resendAsynchronously(batchId, uniqueMessageId); ScriptMailResult scriptMailResult = new ScriptMailResult(new DefaultMailResult(batchId), statusResult); return scriptMailResult; } catch (MailStoreException e) { setError(e); return null; } }  }
DeprecatedMailStorageScriptService extends AbstractMailScriptService { public ScriptMailResult resendAsynchronously(String batchId, String uniqueMessageId) { try { MailStatusResult statusResult = this.mailResender.resendAsynchronously(batchId, uniqueMessageId); ScriptMailResult scriptMailResult = new ScriptMailResult(new DefaultMailResult(batchId), statusResult); return scriptMailResult; } catch (MailStoreException e) { setError(e); return null; } }  ScriptMailResult resend(String batchId, String uniqueMessageId); ScriptMailResult resendAsynchronously(String batchId, String uniqueMessageId); List<ScriptMailResult> resendAsynchronously(Map<String, Object> filterMap, int offset, int count); MailStatus load(String uniqueMessageId); List<MailStatus> load(Map<String, Object> filterMap, int offset, int count, String sortField,
        boolean sortAscending); long count(Map<String, Object> filterMap); void delete(String batchId); void deleteAll(); void delete(String batchId, String uniqueMessageId); MailStorageConfiguration getConfiguration(); }
DeprecatedMailStorageScriptService extends AbstractMailScriptService { public ScriptMailResult resendAsynchronously(String batchId, String uniqueMessageId) { try { MailStatusResult statusResult = this.mailResender.resendAsynchronously(batchId, uniqueMessageId); ScriptMailResult scriptMailResult = new ScriptMailResult(new DefaultMailResult(batchId), statusResult); return scriptMailResult; } catch (MailStoreException e) { setError(e); return null; } }  ScriptMailResult resend(String batchId, String uniqueMessageId); ScriptMailResult resendAsynchronously(String batchId, String uniqueMessageId); List<ScriptMailResult> resendAsynchronously(Map<String, Object> filterMap, int offset, int count); MailStatus load(String uniqueMessageId); List<MailStatus> load(Map<String, Object> filterMap, int offset, int count, String sortField,
        boolean sortAscending); long count(Map<String, Object> filterMap); void delete(String batchId); void deleteAll(); void delete(String batchId, String uniqueMessageId); MailStorageConfiguration getConfiguration();  }