package cn.enjoy.test;java
import cn.enjoy.App;spring
import cn.enjoy.dao.UsersMapper;app
import cn.enjoy.model.Users;.net
import org.junit.Test;get
import org.junit.runner.RunWith;it
import org.springframework.boot.test.context.SpringBootTest;io
import org.springframework.test.context.junit4.SpringRunner;class
import javax.annotation.Resource;test
@SpringBootTest(classes = {App.class})import
@RunWith(SpringRunner.class)
public class UserTest {
private UsersMapper usersMapper;
public void testAdd() {
Users user = new Users() ;
user.setPasswd("123");
user.setUsername("enjoy");
usersMapper.insertSelective(user);
}
public void testFindUser() {
Users enjoy = usersMapper.findByUsernameAndPasswd("enjoy", "123");
System.out.println(enjoy);
}
}