Commit 919066dbf0c8df937a7062c11e20c1655a1af221
1 parent
d1c6d741
refactor: 使用 IdUtil.randomUUID 代替 UUID.randomUUID()
Showing
1 changed file
with
2 additions
and
2 deletions
yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceTest.java
| 1 | package cn.iocoder.yudao.module.trade.service.order; | 1 | package cn.iocoder.yudao.module.trade.service.order; |
| 2 | 2 | ||
| 3 | +import cn.hutool.core.util.IdUtil; | ||
| 3 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | 4 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 4 | import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | 5 | import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; |
| 5 | import cn.iocoder.yudao.module.member.api.address.MemberAddressApi; | 6 | import cn.iocoder.yudao.module.member.api.address.MemberAddressApi; |
| @@ -38,7 +39,6 @@ import org.springframework.boot.test.mock.mockito.MockBean; | @@ -38,7 +39,6 @@ import org.springframework.boot.test.mock.mockito.MockBean; | ||
| 38 | import org.springframework.context.annotation.Import; | 39 | import org.springframework.context.annotation.Import; |
| 39 | 40 | ||
| 40 | import java.time.Duration; | 41 | import java.time.Duration; |
| 41 | -import java.util.UUID; | ||
| 42 | 42 | ||
| 43 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; | 43 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; |
| 44 | import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; | 44 | import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; |
| @@ -101,7 +101,7 @@ public class TradeOrderUpdateServiceTest extends BaseDbUnitTest { | @@ -101,7 +101,7 @@ public class TradeOrderUpdateServiceTest extends BaseDbUnitTest { | ||
| 101 | public void setUp() { | 101 | public void setUp() { |
| 102 | when(tradeOrderProperties.getAppId()).thenReturn(888L); | 102 | when(tradeOrderProperties.getAppId()).thenReturn(888L); |
| 103 | when(tradeOrderProperties.getPayExpireTime()).thenReturn(Duration.ofDays(1)); | 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 | // @Test | 107 | // @Test |