From 4b27731803251b4d38cd57f3943de64bda00c294 Mon Sep 17 00:00:00 2001 From: zhouxiunai <154707516@qq.com> Date: Wed, 9 Jan 2019 16:22:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=88=AA=E7=8F=AD=E6=9C=80?= =?UTF-8?q?=E5=90=8E=E9=80=9A=E7=9F=A5=E6=97=B6=E9=97=B4=E7=9A=84=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../msghandler/LACLHandlerTest.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/test/java/com/gzzn/omms/msgexchangeapi/msghandler/LACLHandlerTest.java 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)); + } +}