| | |
| | | }); |
| | | 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) { |
| | |
| | | } |
| | | |
| | | @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 |