test: fix test cases

This commit is contained in:
zmstone 2024-04-17 15:04:03 +02:00
parent d49e98bc4b
commit 5c014f4c29
4 changed files with 7 additions and 7 deletions

View File

@ -756,8 +756,8 @@ producer_strategy_key_validator(
producer_strategy_key_validator(emqx_utils_maps:binary_key_map(Conf));
producer_strategy_key_validator(#{
<<"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"};
producer_strategy_key_validator(_) ->
ok.

View File

@ -359,7 +359,7 @@ t_bad_ref(_Config) ->
Refs = [{?MODULE, bad_ref}],
Fields = fields(bad_ref),
?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)
),
ok.

View File

@ -189,7 +189,7 @@ t_nest_object(_Config) ->
t_empty(_Config) ->
?assertThrow(
{error, #{
msg := <<"Object only supports not empty proplists">>,
msg := <<"Object only supports non-empty fields list">>,
args := [],
module := ?MODULE
}},
@ -273,7 +273,7 @@ t_bad_ref(_Config) ->
?assertThrow(
{error, #{
module := ?MODULE,
msg := <<"Object only supports not empty proplists">>
msg := <<"Object only supports non-empty fields list">>
}},
validate(Path, Object, ExpectRefs)
),

View File

@ -20,7 +20,7 @@ all() ->
t_minimal_config(_Config) ->
?assertMatch(
#{
bucket := "bucket",
bucket := <<"bucket">>,
host := "s3.us-east-1.endpoint.com",
port := 443,
min_part_size := 5242880,
@ -45,7 +45,7 @@ t_full_config(_Config) ->
#{
access_key_id := "access_key_id",
acl := public_read,
bucket := "bucket",
bucket := <<"bucket">>,
host := "s3.us-east-1.endpoint.com",
min_part_size := 10485760,
port := 443,