Skip to content

Commit

Permalink
✨ spring-boot-demo-orm-mybatis 完成
Browse files Browse the repository at this point in the history
  • Loading branch information
xkcoding committed Nov 8, 2018
1 parent 41e69d7 commit d34f251
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,29 @@ public class UserMapperTest extends SpringBootDemoOrmMybatisApplicationTests {
@Autowired
private UserMapper userMapper;

/**
* 测试查询所有
*/
@Test
public void selectAllUser() {
List<User> userList = userMapper.selectAllUser();
Assert.assertTrue(CollUtil.isNotEmpty(userList));
log.debug("【userList】= {}", userList);
}

/**
* 测试根据主键查询单个
*/
@Test
public void selectUserById() {
User user = userMapper.selectUserById(1L);
Assert.assertNotNull(user);
log.debug("【user】= {}", user);
}

/**
* 测试保存
*/
@Test
public void saveUser() {
String salt = IdUtil.fastSimpleUUID();
Expand All @@ -53,6 +62,9 @@ public void saveUser() {
Assert.assertEquals(1, i);
}

/**
* 测试根据主键删除
*/
@Test
public void deleteById() {
int i = userMapper.deleteById(1L);
Expand Down

0 comments on commit d34f251

Please sign in to comment.