@Override
    public void closeDiscountActivity(Long id) {
        // 校验存在
        DiscountActivityDO activity = validateDiscountActivityExists(id);
        if (activity.getStatus().equals(CommonStatusEnum.DISABLE.getStatus())) { // 已关闭的活动，不能关闭噢
            throw exception(DISCOUNT_ACTIVITY_CLOSE_FAIL_STATUS_CLOSED);
        }

        // 更新
        DiscountActivityDO updateObj = new DiscountActivityDO().setId(id).setStatus(PromotionActivityStatusEnum.CLOSE.getStatus());
        discountActivityMapper.updateById(updateObj);
    }
@Test
    public void testCloseDiscountActivity() {
        // mock 数据
        DiscountActivityDO dbDiscountActivity = randomPojo(DiscountActivityDO.class,
                o -> o.setStatus(PromotionActivityStatusEnum.WAIT.getStatus()));
        discountActivityMapper.insert(dbDiscountActivity);// @Sql: 先插入出一条存在的数据
        // 准备参数
        Long id = dbDiscountActivity.getId();

        // 调用
        discountActivityService.closeDiscountActivity(id);
        // 校验状态
        DiscountActivityDO discountActivity = discountActivityMapper.selectById(id);
        assertEquals(discountActivity.getStatus(), PromotionActivityStatusEnum.CLOSE.getStatus());
    }