package com.ylx.point.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ylx.point.domain.dto.UserPointDetailQueryDTO;
import com.ylx.point.domain.vo.UserPointDetailVO;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

public class PointUserLogServiceImplTest {

    @Test
    public void pcUserPointDetailRejectsBlankOpenId() {
        PointUserLogServiceImpl service = new PointUserLogServiceImpl();
        UserPointDetailQueryDTO query = new UserPointDetailQueryDTO();
        query.setOpenId(" ");

        IllegalArgumentException exception = assertThrows(IllegalArgumentException.class,
                () -> service.getPcUserPointDetailList(new Page<UserPointDetailVO>(), query));

        assertEquals("openId不能为空", exception.getMessage());
    }
}
