Skip to content

Commit 056f0bc

Browse files
author
Matthias Radestock
committed
add tests for ume configuration permission checks
1 parent 6dc7c06 commit 056f0bc

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
package com.rabbitmq.client.test.functional;
3333

3434
import java.io.IOException;
35+
import java.util.Map;
36+
import java.util.HashMap;
3537

3638
import com.rabbitmq.client.AMQP;
3739
import com.rabbitmq.client.Channel;
@@ -223,6 +225,30 @@ public void with(String name) throws IOException {
223225
}});
224226
}
225227

228+
public void testUmeConfiguration()
229+
throws IOException
230+
{
231+
runTest(false, false, false,
232+
createUmeConfigTest("configure-me"));
233+
runTest(false, false, false,
234+
createUmeConfigTest("configure-and-write-me"));
235+
runTest(false, true, false,
236+
createUmeConfigTest("configure-and-read-me"));
237+
}
238+
239+
protected WithName createUmeConfigTest(final String exchange)
240+
throws IOException
241+
{
242+
return new WithName() {
243+
public void with(String ume) throws IOException {
244+
Map<String, Object> args = new HashMap<String, Object>();
245+
args.put("ume", ume);
246+
channel.exchangeDeclare(exchange, "direct",
247+
false, false, false, args);
248+
channel.exchangeDelete(exchange);
249+
}};
250+
}
251+
226252
protected void runConfigureTest(WithName test)
227253
throws IOException
228254
{

0 commit comments

Comments
 (0)