test: fix test cases
This commit is contained in:
parent
d49e98bc4b
commit
5c014f4c29
|
@ -756,8 +756,8 @@ producer_strategy_key_validator(
|
||||||
producer_strategy_key_validator(emqx_utils_maps:binary_key_map(Conf));
|
producer_strategy_key_validator(emqx_utils_maps:binary_key_map(Conf));
|
||||||
producer_strategy_key_validator(#{
|
producer_strategy_key_validator(#{
|
||||||
<<"partition_strategy">> := key_dispatch,
|
<<"partition_strategy">> := key_dispatch,
|
||||||
<<"message">> := #{<<"key">> := ""}
|
<<"message">> := #{<<"key">> := Key}
|
||||||
}) ->
|
}) when Key =:= "" orelse Key =:= <<>> ->
|
||||||
{error, "Message key cannot be empty when `key_dispatch` strategy is used"};
|
{error, "Message key cannot be empty when `key_dispatch` strategy is used"};
|
||||||
producer_strategy_key_validator(_) ->
|
producer_strategy_key_validator(_) ->
|
||||||
ok.
|
ok.
|
||||||
|
|
|
@ -359,7 +359,7 @@ t_bad_ref(_Config) ->
|
||||||
Refs = [{?MODULE, bad_ref}],
|
Refs = [{?MODULE, bad_ref}],
|
||||||
Fields = fields(bad_ref),
|
Fields = fields(bad_ref),
|
||||||
?assertThrow(
|
?assertThrow(
|
||||||
{error, #{msg := <<"Object only supports not empty proplists">>, args := Fields}},
|
{error, #{msg := <<"Object only supports non-empty fields list">>, args := Fields}},
|
||||||
validate(Path, Spec, Refs)
|
validate(Path, Spec, Refs)
|
||||||
),
|
),
|
||||||
ok.
|
ok.
|
||||||
|
|
|
@ -189,7 +189,7 @@ t_nest_object(_Config) ->
|
||||||
t_empty(_Config) ->
|
t_empty(_Config) ->
|
||||||
?assertThrow(
|
?assertThrow(
|
||||||
{error, #{
|
{error, #{
|
||||||
msg := <<"Object only supports not empty proplists">>,
|
msg := <<"Object only supports non-empty fields list">>,
|
||||||
args := [],
|
args := [],
|
||||||
module := ?MODULE
|
module := ?MODULE
|
||||||
}},
|
}},
|
||||||
|
@ -273,7 +273,7 @@ t_bad_ref(_Config) ->
|
||||||
?assertThrow(
|
?assertThrow(
|
||||||
{error, #{
|
{error, #{
|
||||||
module := ?MODULE,
|
module := ?MODULE,
|
||||||
msg := <<"Object only supports not empty proplists">>
|
msg := <<"Object only supports non-empty fields list">>
|
||||||
}},
|
}},
|
||||||
validate(Path, Object, ExpectRefs)
|
validate(Path, Object, ExpectRefs)
|
||||||
),
|
),
|
||||||
|
|
|
@ -20,7 +20,7 @@ all() ->
|
||||||
t_minimal_config(_Config) ->
|
t_minimal_config(_Config) ->
|
||||||
?assertMatch(
|
?assertMatch(
|
||||||
#{
|
#{
|
||||||
bucket := "bucket",
|
bucket := <<"bucket">>,
|
||||||
host := "s3.us-east-1.endpoint.com",
|
host := "s3.us-east-1.endpoint.com",
|
||||||
port := 443,
|
port := 443,
|
||||||
min_part_size := 5242880,
|
min_part_size := 5242880,
|
||||||
|
@ -45,7 +45,7 @@ t_full_config(_Config) ->
|
||||||
#{
|
#{
|
||||||
access_key_id := "access_key_id",
|
access_key_id := "access_key_id",
|
||||||
acl := public_read,
|
acl := public_read,
|
||||||
bucket := "bucket",
|
bucket := <<"bucket">>,
|
||||||
host := "s3.us-east-1.endpoint.com",
|
host := "s3.us-east-1.endpoint.com",
|
||||||
min_part_size := 10485760,
|
min_part_size := 10485760,
|
||||||
port := 443,
|
port := 443,
|
||||||
|
|
Loading…
Reference in New Issue