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  啓用,也就是壓測時生效。

 

 

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