CtripPlatformEmailService implements EmailService { @Override @SuppressWarnings("unchecked") public boolean checkAsyncEmailResult(EmailResponse response) { try { String emailIDListStr = (String) response.getProperties().get(EmailResponse.KEYS.CHECK_INFO.name()); List<String> emailIDList = decodeListString(emailIDListStr); GetEmailStatusResponse emailStatusResponse = client.getEmailStatus( new GetEmailStatusRequest(CtripAlertEmailTemplate.SEND_CODE, emailIDList)); logger.debug("[checkAsyncEmailResult]Email sent out result: {}", emailStatusResponse); return emailStatusResponse.getResultCode() == 1; }catch (Exception e) { logger.error("check email send response error: ", e); } return false; }  @Override void sendEmail(Email email); @Override CheckEmailResponse checkEmailAddress(String address); @Override CommandFuture<EmailResponse> sendEmailAsync(Email email); @Override CommandFuture<EmailResponse> sendEmailAsync(Email email, Executor executor); @Override @SuppressWarnings("unchecked") boolean checkAsyncEmailResult(EmailResponse response); @Override int getOrder();  }
@Test public void testCheckAsyncEmailResult() throws Exception { CommandFuture<EmailResponse> future = emailService.sendEmailAsync(generateEmail()); EmailResponse response = future.get(); logger.info("response: {}", response.getProperties()); String encode = Codec.DEFAULT.encode(response.getProperties()); EmailResponse newResponse = new EmailResponse() { @Override public Properties getProperties() { return Codec.DEFAULT.decode(encode, Properties.class); } }; logger.info("new Response: {}", newResponse.getProperties()); emailService.checkAsyncEmailResult(newResponse); }