package com.daisy.usercenter.model;
import lombok.Data;
@Data
public class User {
private Long id;
private String name;
private Integer age;
private String email;
}
package com.daisy.usercenter.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface UserMapper extends BaseMapper<User> {
}
视频提取
@SpringBootTest
class UserCenterApplicationTests{
@Resource
private UserMapper userMapper;
@Test
void contextLoads() {
System.out.println(("------selectALL method test ------"));
List<User> userList = userMapper. selectList (null);
Assert.assertEquals(expected:5,userList.size());
userList.forEach(System.out::println);
}
}
视频提取
import org.junit.Test;
import org.junit.runner.Runwith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
import java.util.List;