master
yixian 6 years ago
parent 227944d4d1
commit 0f0f7a7b20

@ -1,6 +1,8 @@
package au.com.royalpay.payment.manage.support.abafile;
import com.alibaba.fastjson.JSONObject;
import org.joda.time.DateTime;
import org.junit.Assert;
import org.junit.Test;
import java.util.Date;
@ -16,8 +18,17 @@ public class SettleRemarkTemplateDescriberTest {
public void compile() {
JSONObject settle = new JSONObject();
settle.put("client_moniker", "PINE");
SettleRemarkTemplateDescriber describer = new SettleRemarkTemplateDescriber("RoyalPay{date(MMdd)}{moniker}", settle, new Date());
SettleRemarkTemplateDescriber describer = new SettleRemarkTemplateDescriber("RoyalPay{date(MMdd)}{moniker}", settle, DateTime.parse("2019-07-18").toDate());
String result = describer.compile();
System.out.println(result);
Assert.assertEquals("RoyalPay0718PINE", result);
}
@Test
public void compile2() {
JSONObject settle = new JSONObject();
settle.put("client_moniker", "AUPO");
SettleRemarkTemplateDescriber describer = new SettleRemarkTemplateDescriber("Pay By App {date(ddMMyy)}", settle, DateTime.parse("2019-07-18").toDate());
String res = describer.compile();
Assert.assertEquals("Pay By App 180719", res);
}
}
Loading…
Cancel
Save