fix(plugins_api): fix response types and test

This commit is contained in:
Thales Macedo Garitezi 2023-09-04 14:37:25 -03:00
parent 02c3d6a0a7
commit 2cfe5ba057
2 changed files with 7 additions and 3 deletions

View File

@ -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">>)
}
}
}.

View File

@ -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
].