【springboot】 junit 测试
参考:https://blog.csdn.net/u012100371/article/details/77206863
@RunWith(SpringJUnit4ClassRunner.class) @SpringBootTest(classes=Application.class)// 指定spring-boot的启动类 //@SpringApplicationConfiguration(classes = Application.class)// 1.4.0 前版本 public class SpringBootJdbcTest { @Autowired private UserRepository userRepository; @Test public void findAllUsers() { List<User> users = userRepository.findAll(); System.out.println(users); }