parent
55eb47b8f7
commit
be0e8ff40d
@ -0,0 +1,43 @@
|
||||
package au.com.royalpay.payment.manage.task;
|
||||
|
||||
import au.com.royalpay.payment.manage.management.clearing.core.CleanService;
|
||||
import au.com.royalpay.payment.manage.support.abafile.ABAFile;
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
import org.apache.commons.lang3.time.DateUtils;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.thymeleaf.context.Context;
|
||||
import org.thymeleaf.spring4.SpringTemplateEngine;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Create by yixian at 2018-08-21 9:55
|
||||
*/
|
||||
@SpringBootTest
|
||||
@ActiveProfiles({ "proxy", "alipay", "wechat", "jd", "bestpay" })
|
||||
@RunWith(SpringRunner.class)
|
||||
public class SettleMailTest {
|
||||
@Resource
|
||||
private CleanService cleanService;
|
||||
@Resource
|
||||
private SpringTemplateEngine thymeleaf;
|
||||
|
||||
@Test
|
||||
public void parse() throws IOException {
|
||||
Date date = DateUtils.truncate(new Date(), Calendar.DATE);
|
||||
List<ABAFile> abaFileList = cleanService.getAba(date, "CBA");
|
||||
|
||||
Context ctx = new Context();
|
||||
ctx.setVariable("date", DateFormatUtils.format(date, "dd-MM-yyyy"));
|
||||
ctx.setVariable("abaFiles", abaFileList);
|
||||
final String content = thymeleaf.process("mail/settlement_mail", ctx);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue