Skip to content

Commit a7c21a1

Browse files
Rename a function, use ?assertMatch #14079
1 parent f13f993 commit a7c21a1

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

deps/rabbitmq_shovel/src/rabbit_shovel_util.erl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ delete_shovel(VHost, Name, ActingUser) ->
5252
rabbit_log:info("Will delete runtime parameters of shovel '~ts' in virtual host '~ts'", [Name, VHost]),
5353
ok = rabbit_runtime_parameters:clear(VHost, <<"shovel">>, Name, ActingUser);
5454
true ->
55-
report_connot_delete_protected_shovel(Name, VHost, ShovelParameters)
55+
report_that_protected_shovel_cannot_be_deleted(Name, VHost, ShovelParameters)
5656
end
5757
end.
5858

59-
-spec report_connot_delete_protected_shovel(binary(), binary(), map() | [tuple()]) -> no_return().
60-
report_connot_delete_protected_shovel(Name, VHost, ShovelParameters) ->
59+
-spec report_that_protected_shovel_cannot_be_deleted(binary(), binary(), map() | [tuple()]) -> no_return().
60+
report_that_protected_shovel_cannot_be_deleted(Name, VHost, ShovelParameters) ->
6161
case rabbit_shovel_parameters:internal_owner(ShovelParameters) of
6262
undefined ->
6363
rabbit_misc:protocol_error(
@@ -68,7 +68,7 @@ report_connot_delete_protected_shovel(Name, VHost, ShovelParameters) ->
6868
rabbit_misc:protocol_error(
6969
resource_locked,
7070
"Cannot delete protected shovel '~ts' in virtual host '~ts'. It was "
71-
"declared as an protected and can be deleted only by deleting the owner entity: ~ts",
71+
"declared as protected, delete it with --force or delete its owner entity instead: ~ts",
7272
[Name, VHost, rabbit_misc:rs(IOwner)])
7373
end.
7474

deps/rabbitmq_shovel/test/delete_shovel_command_SUITE.erl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,19 +121,18 @@ delete_internal_owner(Config) ->
121121
{<<"dest-queue">>, <<"dest">>}]),
122122
[A] = rabbit_ct_broker_helpers:get_node_configs(Config, nodename),
123123
Opts = #{node => A, vhost => <<"/">>, force => false},
124-
{badrpc,
125-
{'EXIT',
126-
{amqp_error, resource_locked,
127-
"Cannot delete protected shovel 'myshovel' in virtual host '/'. "
128-
"It was declared as an protected and can be deleted only by deleting the owner entity: queue 'src' in vhost '/'",
129-
none}}} = ?CMD:run([<<"myshovel">>], Opts),
124+
?assertMatch(
125+
{badrpc, {'EXIT', {amqp_error, resource_locked, _, none}}},
126+
?CMD:run([<<"myshovel">>], Opts)
127+
),
130128
[_] = rabbit_ct_broker_helpers:rpc(Config, 0, rabbit_shovel_status,
131129
status, []),
132130

133131
ForceOpts = #{node => A, vhost => <<"/">>, force => true},
134132
ok = ?CMD:run([<<"myshovel">>], ForceOpts),
135133
[] = rabbit_ct_broker_helpers:rpc(Config, 0, rabbit_shovel_status,
136134
status, []).
135+
137136
clear_param_on_different_node(Config) ->
138137
shovel_test_utils:set_param(
139138
Config,

0 commit comments

Comments
 (0)