TA的每日心情 | 擦汗 前天 09:07 |
---|
签到天数: 527 天 连续签到: 4 天 [LV.9]测试副司令
|
1测试积点
service层代码
UserService service; - @Autowired
- public void setService(UserService service) {
- this.service = service;
- }
- @Override
- public void add(User user) {
- System.out.println(mapper);
- Thread thread = new Thread(new MyRunnable(mapper, user));
- thread.start();
- }
- class MyRunnable implements Runnable {
- UserMapper mapper;
- User user;
- public MyRunnable(UserMapper mapper, User user) {
- this.mapper = mapper;
- this.user = user;
- System.out.println(mapper);
- System.out.println(user);
- }
- @Override
- public void run() {
- mapper.insert(user);
- }
- }
- @Test
- public void test1() {
- User u1 = new User(1L,"A");
- service.add(u1);
- }
复制代码
|
|