测试类的好处是直接点击即可测试,减少了在Controller层调用使用
demo首先引入相应的pom
junit junit test org.springframework.boot spring-boot-starter-test test
编写相应的测试类就好了,其中ActiveProfiles用于指定环境配置文件
@RunWith(SpringRunner.class)
@SpringBootTest
@ActiveProfiles("dev")
public class Test {
}



