Commit 919066dbf0c8df937a7062c11e20c1655a1af221

Authored by DevDengChao
1 parent d1c6d741

refactor: 使用 IdUtil.randomUUID 代替 UUID.randomUUID()

yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceTest.java
1 1 package cn.iocoder.yudao.module.trade.service.order;
2 2  
  3 +import cn.hutool.core.util.IdUtil;
3 4 import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
4 5 import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
5 6 import cn.iocoder.yudao.module.member.api.address.MemberAddressApi;
... ... @@ -38,7 +39,6 @@ import org.springframework.boot.test.mock.mockito.MockBean;
38 39 import org.springframework.context.annotation.Import;
39 40  
40 41 import java.time.Duration;
41   -import java.util.UUID;
42 42  
43 43 import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals;
44 44 import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo;
... ... @@ -101,7 +101,7 @@ public class TradeOrderUpdateServiceTest extends BaseDbUnitTest {
101 101 public void setUp() {
102 102 when(tradeOrderProperties.getAppId()).thenReturn(888L);
103 103 when(tradeOrderProperties.getPayExpireTime()).thenReturn(Duration.ofDays(1));
104   - when(tradeNoRedisDAO.generate(anyString())).thenReturn(UUID.randomUUID().toString());
  104 + when(tradeNoRedisDAO.generate(anyString())).thenReturn(IdUtil.randomUUID());
105 105 }
106 106  
107 107 // @Test
... ...