diff --git a/apps/emqx/src/emqx_config_handler.erl b/apps/emqx/src/emqx_config_handler.erl index eb1403ec6..05b3d26b0 100644 --- a/apps/emqx/src/emqx_config_handler.erl +++ b/apps/emqx/src/emqx_config_handler.erl @@ -288,7 +288,7 @@ save_configs(ConfKeyPath, AppEnvs, CheckedConf, NewRawConf, OverrideConf, Update %% 2. either the old or the new config is not of map type %% the behaviour is merging the new the config to the old config if they are maps. merge_to_old_config(UpdateReq, RawConf) when is_map(UpdateReq), is_map(RawConf) -> - {ok, emqx_map_lib:deep_merge(RawConf, UpdateReq)}; + {ok, maps:merge(RawConf, UpdateReq)}; merge_to_old_config(UpdateReq, _RawConf) -> {ok, UpdateReq}. diff --git a/apps/emqx_connector/test/emqx_connector_api_SUITE.erl b/apps/emqx_connector/test/emqx_connector_api_SUITE.erl index 7c83671a9..b4c14a596 100644 --- a/apps/emqx_connector/test/emqx_connector_api_SUITE.erl +++ b/apps/emqx_connector/test/emqx_connector_api_SUITE.erl @@ -113,8 +113,14 @@ set_special_configs(_) -> init_per_testcase(_, Config) -> {ok, _} = emqx_cluster_rpc:start_link(node(), emqx_cluster_rpc, 1000), %% assert we there's no connectors and no bridges at first - {ok, 200, <<"[]">>} = request(get, uri(["connectors"]), []), - {ok, 200, <<"[]">>} = request(get, uri(["bridges"]), []), + {ok, 200, Connectors} = request(get, uri(["connectors"]), []), + lists:foreach(fun(#{<<"id">> := ConnectorID}) -> + {ok, 200, <<>>} = request(delete, uri(["connectors", ConnectorID]), []) + end, jsx:decode(Connectors)), + {ok, 200, Bridges} = request(get, uri(["bridges"]), []), + lists:foreach(fun(#{<<"id">> := BridgeID}) -> + {ok, 204, <<>>} = request(delete, uri(["bridges", BridgeID]), []) + end, jsx:decode(Bridges)), Config. end_per_testcase(_, _Config) -> clear_resources(), diff --git a/apps/emqx_modules/test/emqx_rewrite_SUITE.erl b/apps/emqx_modules/test/emqx_rewrite_SUITE.erl index f51642d30..e388790f5 100644 --- a/apps/emqx_modules/test/emqx_rewrite_SUITE.erl +++ b/apps/emqx_modules/test/emqx_rewrite_SUITE.erl @@ -168,7 +168,10 @@ t_update_re_failed(_Config) -> }], Error = {badmatch, {error, - {emqx_modules_schema, + {#{fields => + #{root => [{"rewrite", + {array, {ref,emqx_modules_schema,"rewrite"}}}]}, + roots => [root]}, [{validation_error, #{path => "rewrite.1.re", reason => {<<"*^test/*">>,{"nothing to repeat",0}},