gaoluyang
4 小时以前 7a923e32e55e9c34830690341469cc170f65092e
yudao-module-crm/src/test/java/cn/iocoder/yudao/module/crm/service/bidbond/CrmBidBondQuotationBindingTest.java
@@ -51,6 +51,12 @@
        });
        ReflectionTestUtils.setField(service, "customerService", customerService);
        ReflectionTestUtils.setField(service, "bidBondMapper", bondMapper);
        ReflectionTestUtils.setField(service, "bidProgressMapper",
                stub(cn.iocoder.yudao.module.crm.dal.mysql.bidbond.CrmBidProgressMapper.class,
                        (proxy, method, args) -> {
                            if ("insert".equals(method.getName())) return 1;
                            throw new AssertionError(method.getName());
                        }));
    }
    private void bindQuotation(CrmSaleQuotationDO quotation) {
@@ -98,13 +104,13 @@
    }
    @Test
    void wonRequiresQuotation() {
    void createCannotSetResultDirectly() {
        bindQuotation(new CrmSaleQuotationDO().setId(5L).setNo("BJ5").setCustomerId(1L).setStatus(2));
        CrmBidBondSaveReqVO req = baseReq();
        req.setBidResult(1);
        ServiceException ex = assertThrows(ServiceException.class, () -> service.createBidBond(req));
        assertEquals(BID_BOND_WON_QUOTATION_REQUIRED.getCode(), ex.getCode());
        assertEquals(400, ex.getCode());
    }
    @Test