Commit 1e239b66f991c77c54b8e45c28698c01adba1283
1 parent
4040790e
✨ feat(test): 增加工作订单和批次服务的 Mockito 测试
Showing
3 changed files
with
7 additions
and
0 deletions
yudao-module-mes/src/test/java/cn/iocoder/yudao/module/mes/service/wm/outsourcereceipt/MesWmOutsourceReceiptServiceImplTest.java
| ... | ... | @@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.mes.enums.wm.MesWmOutsourceReceiptStatusEnum; |
| 8 | 8 | import cn.iocoder.yudao.module.mes.enums.wm.MesWmQualityStatusEnum; |
| 9 | 9 | import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemService; |
| 10 | 10 | import cn.iocoder.yudao.module.mes.service.md.vendor.MesMdVendorService; |
| 11 | +import cn.iocoder.yudao.module.mes.service.pro.workorder.MesProWorkOrderService; | |
| 11 | 12 | import cn.iocoder.yudao.module.mes.service.wm.transaction.MesWmTransactionService; |
| 12 | 13 | import org.junit.jupiter.api.Test; |
| 13 | 14 | import org.springframework.context.annotation.Import; |
| ... | ... | @@ -49,6 +50,8 @@ public class MesWmOutsourceReceiptServiceImplTest extends BaseDbUnitTest { |
| 49 | 50 | private MesMdVendorService vendorService; |
| 50 | 51 | @MockitoBean |
| 51 | 52 | private MesMdItemService itemService; |
| 53 | + @MockitoBean | |
| 54 | + private MesProWorkOrderService workOrderService; | |
| 52 | 55 | |
| 53 | 56 | @Test |
| 54 | 57 | public void testUpdateOutsourceReceiptWhenIqcFinish_success_bothQualifiedAndUnqualified() { | ... | ... |
yudao-module-mes/src/test/java/cn/iocoder/yudao/module/mes/service/wm/productsales/MesWmProductSalesLineServiceImplTest.java
| ... | ... | @@ -11,6 +11,7 @@ import org.springframework.context.annotation.Import; |
| 11 | 11 | import org.springframework.test.context.bean.override.mockito.MockitoBean; |
| 12 | 12 | |
| 13 | 13 | import cn.iocoder.yudao.module.mes.service.md.item.MesMdItemService; |
| 14 | +import cn.iocoder.yudao.module.mes.service.wm.batch.MesWmBatchService; | |
| 14 | 15 | |
| 15 | 16 | import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; |
| 16 | 17 | import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; |
| ... | ... | @@ -39,6 +40,8 @@ public class MesWmProductSalesLineServiceImplTest extends BaseDbUnitTest { |
| 39 | 40 | |
| 40 | 41 | @MockitoBean |
| 41 | 42 | private MesMdItemService itemService; |
| 43 | + @MockitoBean | |
| 44 | + private MesWmBatchService batchService; | |
| 42 | 45 | |
| 43 | 46 | @Test |
| 44 | 47 | public void testUpdateProductSalesLineWhenOqcFinish_pass() { | ... | ... |
yudao-module-mes/src/test/resources/sql/create_tables.sql
| ... | ... | @@ -390,6 +390,7 @@ CREATE TABLE IF NOT EXISTS "mes_wm_product_sales_line" ( |
| 390 | 390 | "item_id" bigint NOT NULL, |
| 391 | 391 | "quantity" decimal(20,6) NOT NULL, |
| 392 | 392 | "batch_id" bigint DEFAULT NULL, |
| 393 | + "batch_code" varchar(255) DEFAULT NULL, | |
| 393 | 394 | "material_stock_id" bigint DEFAULT NULL, |
| 394 | 395 | "oqc_check_flag" tinyint DEFAULT NULL, |
| 395 | 396 | "oqc_id" bigint DEFAULT NULL, | ... | ... |