test: resource creation now checks health

adjust test case to work with new code behavior
This commit is contained in:
Zaiming (Stone) Shi 2022-01-04 00:43:29 +01:00
parent 7b478817bd
commit e3c8f67aaf
1 changed files with 5 additions and 6 deletions

View File

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