Explorar o código

fix(tests): fix check apps api test cases

Turtle %!s(int64=4) %!d(string=hai) anos
pai
achega
fa37151b69
Modificáronse 1 ficheiros con 9 adicións e 2 borrados
  1. 9 2
      apps/emqx_management/src/emqx_mgmt_http.erl

+ 9 - 2
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.