From cb31032e6d9964fd973bd820393dbfdda51cd408 Mon Sep 17 00:00:00 2001 From: firest Date: Wed, 31 May 2023 18:06:06 +0800 Subject: [PATCH] chore: make dialyzer && test happy --- .../src/emqx_bridge_iotdb.app.src | 2 +- .../src/emqx_bridge_iotdb_impl.erl | 26 +++++++++---------- .../test/emqx_connector_http_tests.erl | 3 ++- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/apps/emqx_bridge_iotdb/src/emqx_bridge_iotdb.app.src b/apps/emqx_bridge_iotdb/src/emqx_bridge_iotdb.app.src index cebf60cb1..a3e4f1eb3 100644 --- a/apps/emqx_bridge_iotdb/src/emqx_bridge_iotdb.app.src +++ b/apps/emqx_bridge_iotdb/src/emqx_bridge_iotdb.app.src @@ -1,7 +1,7 @@ %% -*- mode: erlang -*- {application, emqx_bridge_iotdb, [ {description, "EMQX Enterprise Apache IoTDB Bridge"}, - {vsn, "0.1.1"}, + {vsn, "0.1.2"}, {modules, [ emqx_bridge_iotdb, emqx_bridge_iotdb_impl diff --git a/apps/emqx_bridge_iotdb/src/emqx_bridge_iotdb_impl.erl b/apps/emqx_bridge_iotdb/src/emqx_bridge_iotdb_impl.erl index f19fc0839..5d214850d 100644 --- a/apps/emqx_bridge_iotdb/src/emqx_bridge_iotdb_impl.erl +++ b/apps/emqx_bridge_iotdb/src/emqx_bridge_iotdb_impl.erl @@ -23,35 +23,35 @@ scheme := http | https, host := iolist(), port := inet:port_number(), - path := '_' + path := _ }, connect_timeout := pos_integer(), pool_type := random | hash, pool_size := pos_integer(), - request := undefined | map(), - is_aligned := boolean(), - iotdb_version := binary(), - device_id := binary() | undefined, - atom() => '_' + request => undefined | map(), + is_aligned => boolean(), + iotdb_version => binary(), + device_id => binary() | undefined, + atom() => _ }. -type state() :: #{ - base_path := '_', + base_path := _, base_url := #{ scheme := http | https, host := iolist(), port := inet:port_number(), - path := '_' + path := _ }, connect_timeout := pos_integer(), pool_type := random | hash, pool_size := pos_integer(), - request := undefined | map(), - is_aligned := boolean(), - iotdb_version := binary(), - device_id := binary() | undefined, - atom() => '_' + request => undefined | map(), + is_aligned => boolean(), + iotdb_version => binary(), + device_id => binary() | undefined, + atom() => _ }. -type manager_id() :: binary(). diff --git a/apps/emqx_connector/test/emqx_connector_http_tests.erl b/apps/emqx_connector/test/emqx_connector_http_tests.erl index 8d0fa6d2c..2dc2119f7 100644 --- a/apps/emqx_connector/test/emqx_connector_http_tests.erl +++ b/apps/emqx_connector/test/emqx_connector_http_tests.erl @@ -25,7 +25,8 @@ wrap_auth_headers_test_() -> meck:expect(ehttpc_sup, start_pool, 2, {ok, foo}), meck:expect(ehttpc, request, fun(_, _, Req, _, _) -> {ok, 200, Req} end), meck:expect(ehttpc_pool, pick_worker, 1, self()), - [ehttpc_sup, ehttpc, ehttpc_pool] + meck:expect(emqx_resource, allocate_resource, 3, ok), + [ehttpc_sup, ehttpc, ehttpc_pool, emqx_resource] end, fun meck:unload/1, fun(_) -> Config = #{