@@ -137,18 +137,25 @@ subscribe_topic_authorisation(Config) ->
137137
138138change_default_topic_exchange (Config ) ->
139139 Channel = ? config (amqp_channel , Config ),
140- ClientFoo = ? config (client_foo , Config ),
140+ Version = ? config (version , Config ),
141+ StompPort = rabbit_ct_broker_helpers :get_node_config (Config , 0 , tcp_port_stomp ),
141142 Ex = <<" my-topic-exchange" >>,
143+ ok = rabbit_ct_broker_helpers :rpc (Config , 0 , application , set_env , [rabbitmq_stomp , default_topic_exchange , Ex ]),
144+ {ok , ClientFoo } = rabbit_stomp_client :connect (Version , StompPort ),
142145 AuthorisedTopic = " /topic/user.AuthorisedTopic" ,
143146
144147 Declare = # 'exchange.declare' {exchange = Ex , type = <<" topic" >>},
145148 # 'exchange.declare_ok' {} = amqp_channel :call (Channel , Declare ),
146149
147- ok = rabbit_ct_broker_helpers :rpc (Config , 0 , application , set_env , [rabbitmq_stomp , default_topic_exchange , Ex ] ),
150+ 0 = length ( rabbit_ct_broker_helpers :rpc (Config , 0 , rabbit_binding , list_for_source , [# resource { virtual_host = << " / " >>, kind = exchange , name = Ex }]) ),
148151
149152 rabbit_stomp_client :send (
150153 ClientFoo , " SUBSCRIBE" , [{" destination" , AuthorisedTopic }]),
151154
155+ timer :sleep (500 ),
156+
157+ 1 = length (rabbit_ct_broker_helpers :rpc (Config , 0 , rabbit_binding , list_for_source , [# resource {virtual_host = <<" /" >>, kind = exchange , name = Ex }])),
158+
152159 rabbit_stomp_client :send (
153160 ClientFoo , " SEND" , [{" destination" , AuthorisedTopic }], [" ohai there" ]),
154161
@@ -158,6 +165,7 @@ change_default_topic_exchange(Config) ->
158165 Delete = # 'exchange.delete' {exchange = Ex },
159166 # 'exchange.delete_ok' {} = amqp_channel :call (Channel , Delete ),
160167 ok = rabbit_ct_broker_helpers :rpc (Config , 0 , application , unset_env , [rabbitmq_stomp , default_topic_exchange ]),
168+ rabbit_stomp_client :disconnect (ClientFoo ),
161169 ok .
162170
163171
0 commit comments