From fa37151b69f660003b217b935928d4f284a3bc54 Mon Sep 17 00:00:00 2001 From: Turtle Date: Mon, 26 Jul 2021 19:38:09 +0800 Subject: [PATCH] fix(tests): fix check apps api test cases --- apps/emqx_management/src/emqx_mgmt_http.erl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/emqx_management/src/emqx_mgmt_http.erl b/apps/emqx_management/src/emqx_mgmt_http.erl index 8c351ae9d..85165412c 100644 --- a/apps/emqx_management/src/emqx_mgmt_http.erl +++ b/apps/emqx_management/src/emqx_mgmt_http.erl @@ -54,11 +54,10 @@ start_listener({Proto, Port, Options}) -> type => apiKey, name => "authorization", in => header}}}}, - Modules = minirest_api:find_api_modules(apps()) -- [emqx_mgmt_api_apps], Minirest = #{ protocol => Proto, base_path => ?BASE_PATH, - modules => Modules, + modules => api_modules(), authorization => Authorization, security => [#{application => []}], swagger_global_spec => GlobalSpec}, @@ -117,3 +116,11 @@ apps() -> _ -> false end end, Apps). + +-ifdef(TEST). +api_modules() -> + minirest_api:find_api_modules(apps()). +-else. +api_modules() -> + minirest_api:find_api_modules(apps()) -- [emqx_mgmt_api_apps]. +-endif.