diff --git a/src/test/java/com/gzzn/omms/msgexchangeapi/msghandler/LACLHandlerTest.java b/src/test/java/com/gzzn/omms/msgexchangeapi/msghandler/LACLHandlerTest.java new file mode 100644 index 00000000..4786b564 --- /dev/null +++ b/src/test/java/com/gzzn/omms/msgexchangeapi/msghandler/LACLHandlerTest.java @@ -0,0 +1,38 @@ +package com.gzzn.omms.msgexchangeapi.msghandler; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import com.gzzn.omms.msgexchangeapi.dao.CminmsgDao; +import com.gzzn.omms.msgexchangeapi.entity.Cminmsg; +import com.gzzn.omms.msgexchangeapi.entity.CminmsgWapper; +import com.gzzn.omms.msgexchangeapi.msghandler.flop.LACLHandler; +import com.gzzn.omms.msgexchangeapi.service.exchange.IExchangeService; +import com.gzzn.omms.msgexchangeapi.utils.JsonUtil; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class LACLHandlerTest { + + @Autowired + private CminmsgDao cminmsgDao; + + @Autowired + private IExchangeService exchangeService; + + @Test + public void testRun() + { + Cminmsg cminmsg = cminmsgDao.findOne(99370L); + CminmsgWapper cminmsgWapper = new CminmsgWapper(cminmsg); + cminmsgWapper.setMsg(exchangeService.xmlToMsg(cminmsg.getCminmsgsClobMsg())); + + LACLHandler laclhandler = new LACLHandler(); + HandlerResult result = laclhandler.run(cminmsgWapper); + + System.out.println(JsonUtil.getString(result)); + } +}