From e3c8f67aaf3bc11fa44a75e5d3c24bd7ffbe1ef0 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Tue, 4 Jan 2022 00:43:29 +0100 Subject: [PATCH] test: resource creation now checks health adjust test case to work with new code behavior --- apps/emqx_authz/test/emqx_authz_http_SUITE.erl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/emqx_authz/test/emqx_authz_http_SUITE.erl b/apps/emqx_authz/test/emqx_authz_http_SUITE.erl index 2187fba73..9a3b86958 100644 --- a/apps/emqx_authz/test/emqx_authz_http_SUITE.erl +++ b/apps/emqx_authz/test/emqx_authz_http_SUITE.erl @@ -343,17 +343,16 @@ t_create_replace(_Config) -> listener => {tcp, default} }, - %% Bad URL + %% Create with valid URL ok = setup_handler_and_config( fun(Req0, State) -> Req = cowboy_req:reply(200, Req0), {ok, Req, State} end, - #{<<"base_url">> => <<"http://127.0.0.1:33331/authz">>}), - + #{<<"base_url">> => <<"http://127.0.0.1:33333/authz">>}), ?assertEqual( - deny, + allow, emqx_access_control:authorize(ClientInfo, publish, <<"t">>)), %% Changing to other bad config does not work @@ -366,14 +365,14 @@ t_create_replace(_Config) -> emqx_authz:update({?CMD_REPLACE, http}, BadConfig)), ?assertEqual( - deny, + allow, emqx_access_control:authorize(ClientInfo, publish, <<"t">>)), %% Changing to valid config OkConfig = maps:merge( raw_http_authz_config(), #{<<"base_url">> => <<"http://127.0.0.1:33333/authz">>}), - + ?assertMatch( {ok, _}, emqx_authz:update({?CMD_REPLACE, http}, OkConfig)),