From ce78a4eb0b3d5ad1c20884c6c7b84b7bf8c88cae Mon Sep 17 00:00:00 2001 From: sin <2943460818@qq.com> Date: Tue, 14 May 2019 19:19:46 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BF=AE=E6=94=B9=20package?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/{ => biz}/OrderApplicationTest.java | 2 +- .../order/biz/mapper/OrderMapperTest.java | 37 +++++++++++++++++++ .../biz/service/OrderServiceImplTest.java | 9 +---- 3 files changed, 39 insertions(+), 9 deletions(-) rename order/order-service-impl/src/test/java/cn/iocoder/mall/order/{ => biz}/OrderApplicationTest.java (90%) create mode 100644 order/order-service-impl/src/test/java/cn/iocoder/mall/order/biz/mapper/OrderMapperTest.java diff --git a/order/order-service-impl/src/test/java/cn/iocoder/mall/order/OrderApplicationTest.java b/order/order-service-impl/src/test/java/cn/iocoder/mall/order/biz/OrderApplicationTest.java similarity index 90% rename from order/order-service-impl/src/test/java/cn/iocoder/mall/order/OrderApplicationTest.java rename to order/order-service-impl/src/test/java/cn/iocoder/mall/order/biz/OrderApplicationTest.java index 664a1bd44..3cce3b6b8 100644 --- a/order/order-service-impl/src/test/java/cn/iocoder/mall/order/OrderApplicationTest.java +++ b/order/order-service-impl/src/test/java/cn/iocoder/mall/order/biz/OrderApplicationTest.java @@ -1,4 +1,4 @@ -package cn.iocoder.mall.order; +package cn.iocoder.mall.order.biz; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/order/order-service-impl/src/test/java/cn/iocoder/mall/order/biz/mapper/OrderMapperTest.java b/order/order-service-impl/src/test/java/cn/iocoder/mall/order/biz/mapper/OrderMapperTest.java new file mode 100644 index 000000000..0a57e40e9 --- /dev/null +++ b/order/order-service-impl/src/test/java/cn/iocoder/mall/order/biz/mapper/OrderMapperTest.java @@ -0,0 +1,37 @@ +package cn.iocoder.mall.order.biz.mapper; + +import cn.iocoder.mall.order.biz.OrderApplicationTest; +import cn.iocoder.mall.order.biz.dao.OrderMapper; +import cn.iocoder.mall.order.biz.dataobject.OrderDO; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import org.junit.Assert; +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 org.springframework.transaction.annotation.Transactional; + +/** + * mapper test + * + * @author Sin + * @time 2019/5/13 10:45 PM + */ +@RunWith(SpringRunner.class) +@SpringBootTest(classes = OrderApplicationTest.class) +@Transactional +public class OrderMapperTest { + + @Autowired + private OrderMapper orderMapper; + + @Test + public void updateByIdTest() { + int id = 47; +// int updateStatus = 99; +// int res = orderMapper.update(new OrderDO().setStatus(id), new UpdateWrapper().eq("id", updateStatus)); + OrderDO orderDO = orderMapper.selectById(id); +// Assert.assertTrue(orderDO.getStatus() == updateStatus); + } +} diff --git a/order/order-service-impl/src/test/java/cn/iocoder/mall/order/biz/service/OrderServiceImplTest.java b/order/order-service-impl/src/test/java/cn/iocoder/mall/order/biz/service/OrderServiceImplTest.java index 0f9bc56ca..a92cb9ff3 100644 --- a/order/order-service-impl/src/test/java/cn/iocoder/mall/order/biz/service/OrderServiceImplTest.java +++ b/order/order-service-impl/src/test/java/cn/iocoder/mall/order/biz/service/OrderServiceImplTest.java @@ -1,13 +1,8 @@ package cn.iocoder.mall.order.biz.service; -import cn.iocoder.common.framework.vo.CommonResult; -import cn.iocoder.mall.order.OrderApplicationTest; +import cn.iocoder.mall.order.biz.OrderApplicationTest; import cn.iocoder.mall.order.api.OrderService; -import cn.iocoder.mall.order.api.bo.OrderCreateBO; -import cn.iocoder.mall.order.api.dto.OrderCreateDTO; import cn.iocoder.mall.order.biz.dao.OrderMapper; -import cn.iocoder.mall.order.biz.dataobject.OrderDO; -import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -15,8 +10,6 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.transaction.annotation.Transactional; -import java.util.Arrays; - /** * 订单 service test *