| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.sinata.appointment.entity.AppointmentOrder; |
| | | import com.sinata.appointment.entity.BizVisitReason; |
| | | import com.sinata.appointment.entity.MpUser; |
| | | import com.sinata.appointment.integration.WechatMiniGateway; |
| | | import com.sinata.appointment.mapper.ApprovalTaskMapper; |
| | | import com.sinata.appointment.mapper.AppointmentVisitorMapper; |
| | | import com.sinata.appointment.mapper.BizVisitReasonMapper; |
| | | import com.sinata.appointment.mapper.MpUserMapper; |
| | | import java.time.LocalDate; |
| | |
| | | private ApprovalTaskMapper approvalTaskMapper; |
| | | |
| | | @Mock |
| | | private AppointmentVisitorMapper appointmentVisitorMapper; |
| | | |
| | | @Mock |
| | | private BizVisitReasonMapper bizVisitReasonMapper; |
| | | |
| | | private IntegrationWechatService integrationWechatService; |
| | |
| | | wechatMiniGateway, |
| | | mpUserMapper, |
| | | approvalTaskMapper, |
| | | appointmentVisitorMapper, |
| | | bizVisitReasonMapper); |
| | | } |
| | | |
| | |
| | | submitter.setOpenId("openid-123"); |
| | | submitter.setNickName("张三"); |
| | | |
| | | BizVisitReason reason = new BizVisitReason(); |
| | | reason.setReasonCode("BUSINESS"); |
| | | reason.setReasonName("商务洽谈"); |
| | | |
| | | when(mpUserMapper.selectOne(any(LambdaQueryWrapper.class))).thenReturn(submitter); |
| | | when(bizVisitReasonMapper.selectOne(any(LambdaQueryWrapper.class))).thenReturn(reason); |
| | | |
| | | integrationWechatService.notifyApprovalFinalResult(order, true); |
| | | |
| | |
| | | verify(wechatMiniGateway) |
| | | .sendSubscribeMessage( |
| | | eq("openid-123"), |
| | | eq("4FQovCBNFM7rth42AWHTusHajO788eT9VpplSN4ZG2s"), |
| | | eq("rIJpfN51_q818RTpJAqTe5ssTwWCHnxDM5rpq64uuKM"), |
| | | eq("pages/record/index"), |
| | | dataCaptor.capture()); |
| | | |
| | | Map<String, String> payload = dataCaptor.getValue(); |
| | | assertEquals("审核通过", payload.get("thing1")); |
| | | assertEquals("张三", payload.get("thing2")); |
| | | assertEquals("2026-04-24 09:00", payload.get("time3")); |
| | | assertEquals("商务洽谈", payload.get("thing4")); |
| | | assertEquals("通过", payload.get("phrase4")); |
| | | assertEquals("2026-04-24 09:00", payload.get("time2")); |
| | | assertEquals("预约审核通过", payload.get("thing5")); |
| | | } |
| | | |
| | | @Test |