@RunWith(SpringRunner.class)@SpringBootTestpublicclassUserServiceImplTest{@AutowiredprivateUserService userService;@TestpublicvoidinsertUser(){ User user =newUser(); user.setUsername("li ning"); user.setPassword("123456"); userService.insertUser(user); }}复制代码 上面的测试非常简单,主要需要注意两...