@@ -154,21 +154,22 @@ public void shouldStartTheWholeEnchilada() throws IOException, InterruptedExcept
154
154
{
155
155
try (RabbitMQContainer container = new RabbitMQContainer ()) {
156
156
container
157
- .withVhost ("vhost1" )
158
- .withVhostLimit ("vhost1" , "max-connections" , 1 )
159
- .withVhost ("vhost2" , true )
160
- .withExchange ("direct-exchange" , "direct" )
161
- .withExchange ("topic-exchange" , "topic" )
162
- .withQueue ("queue1" )
163
- .withQueue ("queue2" , true , false , ImmutableMap .of ("x-message-ttl" , 1000 ))
164
- .withBinding ("direct-exchange" , "queue1" )
165
- .withUser ("user1" , "password1" )
166
- .withUser ("user2" , "password2" , ImmutableSet .of ("administrator" ))
167
- .withPermission ("vhost1" , "user1" , ".*" , ".*" , ".*" )
168
- .withPolicy ("max length policy" , "^dog" , ImmutableMap .of ("max-length" , 1 ), 1 , "queues" )
169
- .withPolicy ("alternate exchange policy" , "^direct-exchange" , ImmutableMap .of ("alternate-exchange" , "amq.direct" ))
170
- .withOperatorPolicy ("operator policy 1" , "^queue1" , ImmutableMap .of ("message-ttl" , 1000 ), 1 , "queues" )
171
- .withPluginsEnabled ("rabbitmq_shovel" , "rabbitmq_random_exchange" );
157
+ .withVhost ("vhost1" )
158
+ .withVhostLimit ("vhost1" , "max-connections" , 1 )
159
+ .withVhost ("vhost2" , true )
160
+ .withExchange ("direct-exchange" , "direct" )
161
+ .withExchange ("topic-exchange" , "topic" )
162
+ .withQueue ("queue1" )
163
+ .withQueue ("queue2" , true , false , ImmutableMap .of ("x-message-ttl" , 1000 ))
164
+ .withBinding ("direct-exchange" , "queue1" )
165
+ .withUser ("user1" , "password1" )
166
+ .withUser ("user2" , "password2" , ImmutableSet .of ("administrator" ))
167
+ .withPermission ("vhost1" , "user1" , ".*" , ".*" , ".*" )
168
+ .withPolicy ("max length policy" , "^dog" , ImmutableMap .of ("max-length" , 1 ), 1 , "queues" )
169
+ .withPolicy ("alternate exchange policy" , "^direct-exchange" , ImmutableMap .of ("alternate-exchange" , "amq.direct" ))
170
+ .withPolicy ("vhost2" , "ha-all" , ".*" , ImmutableMap .of ("ha-mode" , "all" , "ha-sync-mode" , "automatic" ))
171
+ .withOperatorPolicy ("operator policy 1" , "^queue1" , ImmutableMap .of ("message-ttl" , 1000 ), 1 , "queues" )
172
+ .withPluginsEnabled ("rabbitmq_shovel" , "rabbitmq_random_exchange" );
172
173
173
174
container .start ();
174
175
@@ -192,6 +193,10 @@ public void shouldStartTheWholeEnchilada() throws IOException, InterruptedExcept
192
193
.getStdout ())
193
194
.contains ("max length policy" , "alternate exchange policy" );
194
195
196
+ assertThat (container .execInContainer ("rabbitmqadmin" , "list" , "policies" , "--vhost=vhost2" )
197
+ .getStdout ())
198
+ .contains ("ha-all" , "ha-sync-mode" );
199
+
195
200
assertThat (container .execInContainer ("rabbitmqadmin" , "list" , "operator_policies" )
196
201
.getStdout ())
197
202
.contains ("operator policy 1" );
0 commit comments