Просмотр исходного кода

fix(plugins_api): fix response types and test

Thales Macedo Garitezi 2 лет назад
Родитель
Сommit
2cfe5ba057

+ 4 - 1
apps/emqx_management/src/emqx_mgmt_api_plugins.erl

@@ -166,7 +166,10 @@ schema("/plugins/:name/move") ->
             tags => ?TAGS,
             parameters => [hoconsc:ref(name)],
             'requestBody' => move_request_body(),
-            responses => #{200 => <<"OK">>}
+            responses => #{
+                200 => <<"OK">>,
+                400 => emqx_dashboard_swagger:error_codes(['MOVE_FAILED'], <<"Move failed">>)
+            }
         }
     }.
 

+ 3 - 2
apps/emqx_management/test/emqx_mgmt_api_plugins_SUITE.erl

@@ -297,7 +297,8 @@ update_plugin(Config, Name, Action) when is_list(Config) ->
 update_boot_order(Name, MoveBody, Config) ->
     #{host := Host, auth := Auth} = get_host_and_auth(Config),
     Path = emqx_mgmt_api_test_util:api_path(Host, ["plugins", Name, "move"]),
-    case emqx_mgmt_api_test_util:request_api(post, Path, "", Auth, MoveBody) of
+    Opts = #{return_all => true},
+    case emqx_mgmt_api_test_util:request_api(post, Path, "", Auth, MoveBody, Opts) of
         {ok, Res} ->
             Resp =
                 case emqx_utils_json:safe_decode(Res, [return_maps]) of
@@ -362,8 +363,8 @@ cluster(TestCase, Config) ->
 
 app_specs(_Config) ->
     [
-        emqx_conf,
         emqx,
+        emqx_conf,
         emqx_management,
         emqx_plugins
     ].