test(authn): add test cases

This commit is contained in:
zhouzb 2021-08-03 10:40:08 +08:00
parent 99534e7212
commit 05b72157e2
1 changed files with 2 additions and 0 deletions

View File

@ -101,5 +101,7 @@ t_authenticate(_) ->
username => <<"myuser">>, username => <<"myuser">>,
password => <<"mypass">>}, password => <<"mypass">>},
?assertEqual(ok, emqx_access_control:authenticate(ClientInfo)), ?assertEqual(ok, emqx_access_control:authenticate(ClientInfo)),
?assertEqual(false, emqx_authn:is_enabled()),
emqx_authn:enable(), emqx_authn:enable(),
?assertEqual(true, emqx_authn:is_enabled()),
?assertEqual({error, not_authorized}, emqx_access_control:authenticate(ClientInfo)). ?assertEqual({error, not_authorized}, emqx_access_control:authenticate(ClientInfo)).