springBoot 异常处理 1.pom.xml <!-- 添加junit环境的jar包 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> </dependency> 2.测试类 /** * Spring