这是我的UserServiceTestCase类:(写法上没什么问题,但是报了一个错)
package com.itheima.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.itheima.domain.User;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
public class UserServiceTestCase {
@Autowired
private UserService userService;
@Test
public void testGetById(){
System.out.println(userService.getById(1));
}
@Test
public void testSave() {
User user=new User();
user.setUserid(1);
user.setUsername("Test1");
user.setPassword("123456");
System.out.println(userService.save(user) );
}
@Test
public void testUpdate() {
User user=new User();
user.setUserid(2);
user.setUsername("test2");
user.setPassword("123456");
System.out.println( userService.update(user));
}
@Test
public void testDelete() {
System.out.println( userService.delete(12));
}
@Test
public void testGetALL() {
System.out.println( userService.getAll());
}
@Test
public void testPage() {
IPage page = userService.getPage(1,3);
System.out.println(page.getCurrent());
System.out.println(page.getPages());
System.out.println(page.getSize());
System.out.println(page.getRecords());
System.out.println(page.getTotal());
}
}
这是错误信息:
修改后: