Skip to content

Commit bd34d6b

Browse files
author
Simon MacMullen
committed
Test that unprivileged users can passive declare.
1 parent 4e3f360 commit bd34d6b

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

test/src/com/rabbitmq/client/test/server/Permissions.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,6 @@ public void testExchangeConfiguration()
141141
public void with(String name) throws IOException {
142142
channel.exchangeDeclare(name, "direct");
143143
}});
144-
runConfigureTest(new WithName() {
145-
public void with(String name) throws IOException {
146-
channel.exchangeDeclarePassive(name);
147-
}});
148144
runConfigureTest(new WithName() {
149145
public void with(String name) throws IOException {
150146
channel.exchangeDelete(name);
@@ -158,16 +154,23 @@ public void testQueueConfiguration()
158154
public void with(String name) throws IOException {
159155
channel.queueDeclare(name, false, false, false, null);
160156
}});
161-
runConfigureTest(new WithName() {
162-
public void with(String name) throws IOException {
163-
channel.queueDeclarePassive(name);
164-
}});
165157
runConfigureTest(new WithName() {
166158
public void with(String name) throws IOException {
167159
channel.queueDelete(name);
168160
}});
169161
}
170162

163+
public void testPassiveDeclaration() throws IOException {
164+
adminCh.exchangeDeclare("xxx", "direct");
165+
adminCh.queueDeclare("xxx", false, false, false, null);
166+
// We have no permissions on these but should be able to passive
167+
// declare them anyway
168+
channel.exchangeDeclarePassive("xxx");
169+
channel.queueDeclarePassive("xxx");
170+
adminCh.exchangeDelete("xxx");
171+
adminCh.queueDelete("xxx");
172+
}
173+
171174
public void testBinding()
172175
throws IOException
173176
{

0 commit comments

Comments
 (0)