Commit 333db2c6 authored by Data-王博's avatar Data-王博

湖北消金 - 测试接口

parent daf402f5
package cn.quantgroup.financial.service;
import cn.quantgroup.financial.BootStarter;
import cn.quantgroup.financial.model.MailInfo;
import cn.quantgroup.financial.service.sys.IMailService;
import com.alibaba.fastjson.JSON;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
/**
* Created by WuKong on 2017/2/19.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = BootStarter.class)
@WebAppConfiguration
@ActiveProfiles("local")
public class SystemServiceTest {
@Autowired
IMailService mailService;
private Object lock = new Object();
private static final Logger logger = LoggerFactory.getLogger(SystemServiceTest.class);
@Test
public void testSendMailNotice(){
MailInfo mailInfo = new MailInfo();
mailService.saveMailInfo(mailInfo);
synchronized (lock) {
try {
lock.wait();
} catch (InterruptedException e) {
logger.error(e.getMessage(), e);
}
}
}
@Test
public void testJSONMailInfo(){
MailInfo mailInfo = new MailInfo();
mailInfo.setMailtype(new Integer(1).byteValue());
mailInfo.setMail("bo.wang@quantgroup.cn");
System.out.println(JSON.toJSONString(mailInfo));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment