@Testpublicvoidinsert(){User user =newUser();user.setId(6L);user.setName("张三");user.setAge(25);user.setEmail("zhangsan@example.com");userMapper.insert(user);}
@TestpublicvoidupdateById(){User user =newUser();user.setId(6L);user.setAge(28);user.setEmail("zhangsan28@example.com");userMapper.updateById(user);}
日志
数据库数据
查询一条数据
代码
@Testpublicvoidselect(){User user = userMapper.selectById(6);System.out.println(user);}
日志
数据库数据
全部测试代码
packagecom.example;importcom.example.web.entity.User;importcom.example.web.mapper.UserMapper;importorg.junit.jupiter.api.Test;importorg.springframework.beans.factory.annotation.Autowired;importorg.springframework.boot.test.context.SpringBootTest;@SpringBootTestclassMapperTest{@AutowiredprivateUserMapper userMapper;@Testpublicvoidinsert(){User user =newUser();user.setId(6L);user.setName("张三");user.setAge(25);user.setEmail("zhangsan@example.com");userMapper.insert(user);}@Testpublicvoiddelete(){userMapper.deleteById(6);}@TestpublicvoidupdateById(){User user =newUser();user.setId(6L);user.setAge(28);user.setEmail("zhangsan28@example.com");userMapper.updateById(user);}@Testpublicvoidselect(){User user = userMapper.selectById(6);System.out.println(user);}}
组件: element ui中的tooltip组件 思路:通过ref获取宽度进行判断,当子级宽度大于对应标签/父级宽度显示tooltip组件 <div class"bechmark-wrap"><ul ref"bechmarkUl"><liv-for"(item,index) in comp…