test(authz_api): authz sources move api style

This commit is contained in:
JimMoen 2022-03-11 15:58:38 +08:00
parent 68c473c7cc
commit f6ee45b2e6
2 changed files with 6 additions and 6 deletions

View File

@ -186,7 +186,7 @@ t_move_source(_) ->
, #{type := file}
], emqx_authz:lookup()),
{ok, _} = emqx_authz:move(postgresql, <<"top">>),
{ok, _} = emqx_authz:move(postgresql, top),
?assertMatch([ #{type := postgresql}
, #{type := http}
, #{type := mongodb}
@ -195,7 +195,7 @@ t_move_source(_) ->
, #{type := file}
], emqx_authz:lookup()),
{ok, _} = emqx_authz:move(http, <<"bottom">>),
{ok, _} = emqx_authz:move(http, bottom),
?assertMatch([ #{type := postgresql}
, #{type := mongodb}
, #{type := mysql}
@ -204,7 +204,7 @@ t_move_source(_) ->
, #{type := http}
], emqx_authz:lookup()),
{ok, _} = emqx_authz:move(mysql, #{<<"before">> => postgresql}),
{ok, _} = emqx_authz:move(mysql, {before, postgresql}),
?assertMatch([ #{type := mysql}
, #{type := postgresql}
, #{type := mongodb}
@ -213,7 +213,7 @@ t_move_source(_) ->
, #{type := http}
], emqx_authz:lookup()),
{ok, _} = emqx_authz:move(mongodb, #{<<"after">> => http}),
{ok, _} = emqx_authz:move(mongodb, {'after', http}),
?assertMatch([ #{type := mysql}
, #{type := postgresql}
, #{type := redis}

View File

@ -336,7 +336,7 @@ t_move_source(_) ->
], emqx_authz:lookup()),
{ok, 204, _} = request(post, uri(["authorization", "sources", "mysql", "move"]),
#{<<"position">> => #{<<"before">> => <<"postgresql">>}}),
#{<<"position">> => <<"before:postgresql">>}),
?assertMatch([ #{type := mysql}
, #{type := postgresql}
, #{type := mongodb}
@ -345,7 +345,7 @@ t_move_source(_) ->
], emqx_authz:lookup()),
{ok, 204, _} = request(post, uri(["authorization", "sources", "mongodb", "move"]),
#{<<"position">> => #{<<"after">> => <<"http">>}}),
#{<<"position">> => <<"after:http">>}),
?assertMatch([ #{type := mysql}
, #{type := postgresql}
, #{type := redis}