test: ensure atom exists in test module
This commit is contained in:
parent
31c7da9330
commit
ea8d54fd8b
|
@ -139,6 +139,7 @@ kafka_consumer_test() ->
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
message_key_dispatch_validations_test() ->
|
message_key_dispatch_validations_test() ->
|
||||||
|
Name = myproducer,
|
||||||
Conf0 = kafka_producer_new_hocon(),
|
Conf0 = kafka_producer_new_hocon(),
|
||||||
Conf1 =
|
Conf1 =
|
||||||
Conf0 ++
|
Conf0 ++
|
||||||
|
@ -155,7 +156,7 @@ message_key_dispatch_validations_test() ->
|
||||||
<<"message">> := #{<<"key">> := <<>>}
|
<<"message">> := #{<<"key">> := <<>>}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
emqx_utils_maps:deep_get([<<"bridges">>, <<"kafka">>, <<"myproducer">>], Conf)
|
emqx_utils_maps:deep_get([<<"bridges">>, <<"kafka">>, atom_to_binary(Name)], Conf)
|
||||||
),
|
),
|
||||||
?assertThrow(
|
?assertThrow(
|
||||||
{_, [
|
{_, [
|
||||||
|
@ -166,8 +167,6 @@ message_key_dispatch_validations_test() ->
|
||||||
]},
|
]},
|
||||||
check(Conf)
|
check(Conf)
|
||||||
),
|
),
|
||||||
%% ensure atoms exist
|
|
||||||
_ = [myproducer],
|
|
||||||
?assertThrow(
|
?assertThrow(
|
||||||
{_, [
|
{_, [
|
||||||
#{
|
#{
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
%%===========================================================================
|
%%===========================================================================
|
||||||
|
|
||||||
pulsar_producer_validations_test() ->
|
pulsar_producer_validations_test() ->
|
||||||
|
Name = my_producer,
|
||||||
Conf0 = pulsar_producer_hocon(),
|
Conf0 = pulsar_producer_hocon(),
|
||||||
Conf1 =
|
Conf1 =
|
||||||
Conf0 ++
|
Conf0 ++
|
||||||
|
@ -24,7 +25,7 @@ pulsar_producer_validations_test() ->
|
||||||
<<"strategy">> := <<"key_dispatch">>,
|
<<"strategy">> := <<"key_dispatch">>,
|
||||||
<<"message">> := #{<<"key">> := <<>>}
|
<<"message">> := #{<<"key">> := <<>>}
|
||||||
},
|
},
|
||||||
emqx_utils_maps:deep_get([<<"bridges">>, <<"pulsar_producer">>, <<"my_producer">>], Conf)
|
emqx_utils_maps:deep_get([<<"bridges">>, <<"pulsar_producer">>, atom_to_binary(Name)], Conf)
|
||||||
),
|
),
|
||||||
?assertThrow(
|
?assertThrow(
|
||||||
{_, [
|
{_, [
|
||||||
|
@ -35,8 +36,6 @@ pulsar_producer_validations_test() ->
|
||||||
]},
|
]},
|
||||||
check(Conf)
|
check(Conf)
|
||||||
),
|
),
|
||||||
%% ensure atoms exist
|
|
||||||
_ = [my_producer],
|
|
||||||
?assertThrow(
|
?assertThrow(
|
||||||
{_, [
|
{_, [
|
||||||
#{
|
#{
|
||||||
|
|
Loading…
Reference in New Issue