From 77fb8bfc192f197ed95e3a081e8203c4eef0e22f Mon Sep 17 00:00:00 2001 From: JimMoen Date: Tue, 17 May 2022 14:39:43 +0800 Subject: [PATCH] test(mgmt): use pub api with bad params --- apps/emqx_management/test/emqx_mgmt_api_SUITE.erl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/apps/emqx_management/test/emqx_mgmt_api_SUITE.erl b/apps/emqx_management/test/emqx_mgmt_api_SUITE.erl index aa2047ef6..0029b866f 100644 --- a/apps/emqx_management/test/emqx_mgmt_api_SUITE.erl +++ b/apps/emqx_management/test/emqx_mgmt_api_SUITE.erl @@ -447,6 +447,20 @@ t_pubsub(_) -> <<"payload">> => <<"hello">>}), ?assertEqual(?ERROR8, get(<<"code">>, BadClient2)), + {ok, BadParams} = request_api(post, api_path(["mqtt/publish"]), [], auth_header_(), + #{<<"clientid">> => 1, + <<"topics">> => <<"mytopic">>, + <<"qos">> => 1, + <<"payload">> => <<"hello">>, + <<"user_properties">> => + #{<<"id">> => 10010, + <<"name">> => <<"emqx">>, + <<"foo">> => ["bad_properties1", "bad_properties2"], + <<"boolean">> => false + } + }), + ?assertEqual(?ERROR8, get(<<"code">>, BadParams)), + {ok, BadClient3} = request_api(post, api_path(["mqtt/unsubscribe"]), [], auth_header_(), #{<<"clientid">> => 1, <<"topic">> => <<"mytopic">>}),