spring boot 测试-@Profile

@Profile 控制接口的可见

假设有多个配置文件

application.properties  默认

application-pet.properties  性能测试

application-dev.properties  xxx

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

}

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

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章