@@ -44,55 +44,55 @@ defmodule RabbitMQ.CLI.Queues.Commands.GrowCommandTest do
4444 end
4545
4646 test "validate: when one argument is provided, returns a failure" do
47- assert @ command . validate ( [ "quorum-queue-a " ] , % { } ) == { :validation_failure , :not_enough_args }
47+ assert @ command . validate ( [ "target@node " ] , % { } ) == { :validation_failure , :not_enough_args }
4848 end
4949
5050 test "validate: when a node and even are provided, returns a success" do
51- assert @ command . validate ( [ "quorum-queue-a " , "even" ] , % { } ) == :ok
51+ assert @ command . validate ( [ "target@node " , "even" ] , % { } ) == :ok
5252 end
5353
5454 test "validate: when a node and all are provided, returns a success" do
55- assert @ command . validate ( [ "quorum-queue-a " , "all" ] , % { } ) == :ok
55+ assert @ command . validate ( [ "target@node " , "all" ] , % { } ) == :ok
5656 end
5757
5858 test "validate: when a node and something else is provided, returns a failure" do
59- assert @ command . validate ( [ "quorum-queue-a " , "banana" ] , % { } ) ==
59+ assert @ command . validate ( [ "target@node " , "banana" ] , % { } ) ==
6060 { :validation_failure , "strategy 'banana' is not recognised." }
6161 end
6262
6363 test "validate: when three arguments are provided, returns a failure" do
64- assert @ command . validate ( [ "quorum-queue-a " , "extra-arg" , "another-extra-arg" ] , % { } ) ==
64+ assert @ command . validate ( [ "target@node " , "extra-arg" , "another-extra-arg" ] , % { } ) ==
6565 { :validation_failure , :too_many_args }
6666 end
6767
6868 test "validate: when membership promotable is provided, returns a success" do
69- assert @ command . validate ( [ "quorum-queue-a " , "all" ] , % { membership: "promotable" } ) == :ok
69+ assert @ command . validate ( [ "target@node " , "all" ] , % { membership: "promotable" , queue_pattern: "qq.* "} ) == :ok
7070 end
7171
7272 test "validate: when membership voter is provided, returns a success" do
73- assert @ command . validate ( [ "quorum-queue-a " , "all" ] , % { membership: "voter" } ) == :ok
73+ assert @ command . validate ( [ "target@node " , "all" ] , % { membership: "voter" , queue_pattern: "qq.* "} ) == :ok
7474 end
7575
7676 test "validate: when membership non_voter is provided, returns a success" do
77- assert @ command . validate ( [ "quorum-queue-a " , "all" ] , % { membership: "non_voter" } ) == :ok
77+ assert @ command . validate ( [ "target@node " , "all" ] , % { membership: "non_voter" , queue_pattern: "qq.* "} ) == :ok
7878 end
7979
8080 test "validate: when wrong membership is provided, returns failure" do
81- assert @ command . validate ( [ "quorum-queue-a " , "all" ] , % { membership: "banana" } ) ==
81+ assert @ command . validate ( [ "target@node " , "all" ] , % { membership: "banana" , queue_pattern: "qq.* "} ) ==
8282 { :validation_failure , "voter status 'banana' is not recognised." }
8383 end
8484
8585 test "validate: when target quorum cluster size greater than zero, returns a success" do
86- assert @ command . validate ( [ 7 , "all" ] , % { membership: "voter" } ) == :ok
86+ assert @ command . validate ( [ 7 , "all" ] , % { membership: "voter" , queue_pattern: "qq.*" } ) == :ok
8787 end
8888
8989 test "validate: when target quorum cluster size is zero, returns failure" do
90- assert @ command . validate ( [ 0 , "all" ] , % { membership: "voter" } ) ==
90+ assert @ command . validate ( [ 0 , "all" ] , % { membership: "voter" , queue_pattern: "qq.*" } ) ==
9191 { :validation_failure , "target quorum cluster size '0' must be greater than 0." }
9292 end
9393
9494 test "validate: when target quorum cluster size is less than zero, returns failure" do
95- assert @ command . validate ( [ - 1 , "all" ] , % { membership: "voter" } ) ==
95+ assert @ command . validate ( [ - 1 , "all" ] , % { membership: "voter" , queue_pattern: "qq.*" } ) ==
9696 { :validation_failure , "target quorum cluster size '-1' must be greater than 0." }
9797 end
9898
@@ -102,7 +102,7 @@ defmodule RabbitMQ.CLI.Queues.Commands.GrowCommandTest do
102102 { :badrpc , _ } ,
103103 @ command . run (
104104 [ "target@node" , "all" ] ,
105- Map . merge ( context [ :opts ] , % { node: :jake@thedog } )
105+ Map . merge ( context [ :opts ] , % { node: :jake@thedog , queue_pattern: "qq.*" } )
106106 )
107107 )
108108 end
@@ -113,7 +113,7 @@ defmodule RabbitMQ.CLI.Queues.Commands.GrowCommandTest do
113113 { :badrpc , _ } ,
114114 @ command . run (
115115 [ 5 , "all" ] ,
116- Map . merge ( context [ :opts ] , % { node: :jake@thedog } )
116+ Map . merge ( context [ :opts ] , % { node: :jake@thedog , queue_pattern: "qq.*" } )
117117 )
118118 )
119119 end
0 commit comments