test(mgmt): use pub api with bad params

This commit is contained in:
JimMoen 2022-05-17 14:39:43 +08:00
parent d655bea16a
commit 77fb8bfc19
1 changed files with 14 additions and 0 deletions

View File

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