test(emqx_authz): adjust meck and app start order
This commit is contained in:
parent
d0e9d4c4d5
commit
c0ffbd68c8
|
@ -43,12 +43,13 @@ groups() ->
|
|||
[].
|
||||
|
||||
init_per_suite(Config) ->
|
||||
ok = emqx_ct_helpers:start_apps([emqx_authz]),
|
||||
%% important! let emqx_schema include the current app!
|
||||
meck:new(emqx_schema, [non_strict, passthrough, no_history, no_link]),
|
||||
meck:expect(emqx_schema, includes, fun() -> ["authorization"] end ),
|
||||
meck:expect(emqx_schema, extra_schema_fields, fun(FieldName) -> emqx_authz_schema:fields(FieldName) end),
|
||||
|
||||
ok = emqx_ct_helpers:start_apps([emqx_authz]),
|
||||
|
||||
%create_default_app(),
|
||||
Config.
|
||||
|
||||
|
|
|
@ -29,8 +29,6 @@ groups() ->
|
|||
[].
|
||||
|
||||
init_per_suite(Config) ->
|
||||
ok = emqx_ct_helpers:start_apps([emqx_authz]),
|
||||
|
||||
meck:new(emqx_resource, [non_strict, passthrough, no_history, no_link]),
|
||||
meck:expect(emqx_resource, create, fun(_, _, _) -> {ok, meck_data} end ),
|
||||
|
||||
|
@ -39,6 +37,8 @@ init_per_suite(Config) ->
|
|||
meck:expect(emqx_schema, includes, fun() -> ["authorization"] end ),
|
||||
meck:expect(emqx_schema, extra_schema_fields, fun(FieldName) -> emqx_authz_schema:fields(FieldName) end),
|
||||
|
||||
ok = emqx_ct_helpers:start_apps([emqx_authz]),
|
||||
|
||||
ok = emqx_config:update([zones, default, authorization, cache, enable], false),
|
||||
ok = emqx_config:update([zones, default, authorization, enable], true),
|
||||
Rules = [#{ <<"config">> => #{
|
||||
|
|
|
@ -29,16 +29,15 @@ groups() ->
|
|||
[].
|
||||
|
||||
init_per_suite(Config) ->
|
||||
ok = emqx_ct_helpers:start_apps([emqx_authz]),
|
||||
|
||||
meck:new(emqx_resource, [non_strict, passthrough, no_history, no_link]),
|
||||
meck:expect(emqx_resource, create, fun(_, _, _) -> {ok, meck_data} end ),
|
||||
|
||||
%% important! let emqx_schema include the current app!
|
||||
meck:new(emqx_schema, [non_strict, passthrough, no_history, no_link]),
|
||||
meck:expect(emqx_schema, includes, fun() -> ["authorization"] end ),
|
||||
meck:expect(emqx_schema, extra_schema_fields, fun(FieldName) -> emqx_authz_schema:fields(FieldName) end),
|
||||
|
||||
meck:new(emqx_resource, [non_strict, passthrough, no_history, no_link]),
|
||||
meck:expect(emqx_resource, create, fun(_, _, _) -> {ok, meck_data} end),
|
||||
|
||||
ok = emqx_ct_helpers:start_apps([emqx_authz]),
|
||||
ok = emqx_config:update([zones, default, authorization, cache, enable], false),
|
||||
ok = emqx_config:update([zones, default, authorization, enable], true),
|
||||
Rules = [#{ <<"config">> => #{
|
||||
|
|
|
@ -29,7 +29,6 @@ groups() ->
|
|||
[].
|
||||
|
||||
init_per_suite(Config) ->
|
||||
ok = emqx_ct_helpers:start_apps([emqx_authz]),
|
||||
|
||||
meck:new(emqx_resource, [non_strict, passthrough, no_history, no_link]),
|
||||
meck:expect(emqx_resource, create, fun(_, _, _) -> {ok, meck_data} end ),
|
||||
|
@ -39,6 +38,8 @@ init_per_suite(Config) ->
|
|||
meck:expect(emqx_schema, includes, fun() -> ["authorization"] end ),
|
||||
meck:expect(emqx_schema, extra_schema_fields, fun(FieldName) -> emqx_authz_schema:fields(FieldName) end),
|
||||
|
||||
ok = emqx_ct_helpers:start_apps([emqx_authz]),
|
||||
|
||||
ok = emqx_config:update([zones, default, authorization, cache, enable], false),
|
||||
ok = emqx_config:update([zones, default, authorization, enable], true),
|
||||
Rules = [#{ <<"config">> => #{
|
||||
|
|
|
@ -29,8 +29,6 @@ groups() ->
|
|||
[].
|
||||
|
||||
init_per_suite(Config) ->
|
||||
ok = emqx_ct_helpers:start_apps([emqx_authz]),
|
||||
|
||||
meck:new(emqx_resource, [non_strict, passthrough, no_history, no_link]),
|
||||
meck:expect(emqx_resource, create, fun(_, _, _) -> {ok, meck_data} end ),
|
||||
|
||||
|
@ -39,6 +37,8 @@ init_per_suite(Config) ->
|
|||
meck:expect(emqx_schema, includes, fun() -> ["authorization"] end ),
|
||||
meck:expect(emqx_schema, extra_schema_fields, fun(FieldName) -> emqx_authz_schema:fields(FieldName) end),
|
||||
|
||||
ok = emqx_ct_helpers:start_apps([emqx_authz]),
|
||||
|
||||
ok = emqx_config:update([zones, default, authorization, cache, enable], false),
|
||||
ok = emqx_config:update([zones, default, authorization, enable], true),
|
||||
Rules = [#{ <<"config">> => #{
|
||||
|
|
|
@ -29,8 +29,6 @@ groups() ->
|
|||
[].
|
||||
|
||||
init_per_suite(Config) ->
|
||||
ok = emqx_ct_helpers:start_apps([emqx_authz]),
|
||||
|
||||
meck:new(emqx_resource, [non_strict, passthrough, no_history, no_link]),
|
||||
meck:expect(emqx_resource, create, fun(_, _, _) -> {ok, meck_data} end ),
|
||||
|
||||
|
@ -39,6 +37,8 @@ init_per_suite(Config) ->
|
|||
meck:expect(emqx_schema, includes, fun() -> ["authorization"] end ),
|
||||
meck:expect(emqx_schema, extra_schema_fields, fun(FieldName) -> emqx_authz_schema:fields(FieldName) end),
|
||||
|
||||
ok = emqx_ct_helpers:start_apps([emqx_authz]),
|
||||
|
||||
ok = emqx_config:update([zones, default, authorization, cache, enable], false),
|
||||
ok = emqx_config:update([zones, default, authorization, enable], true),
|
||||
Rules = [#{ <<"config">> => #{
|
||||
|
|
Loading…
Reference in New Issue