spring boot 测试-@Profile

梦想的初衷 提交于 2020-01-24 04:50:57

@Profile 控制接口的可见

假设有多个配置文件

application.properties  默认

application-pet.properties  性能测试

application-dev.properties  xxx

@RestController
@Profile({
        "pet"
})
@RequestMapping("/v1/ops/performanceTest/")
public class DebugPerformanceTestController {

}

DebugPerformanceTestController 只在 application-pet.properties  启用,也就是压测时生效。

 

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!