Skip to content

Commit 16de688

Browse files
author
Simon MacMullen
committed
Bring back impersonator tag.
1 parent df2391e commit 16de688

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.rabbitmq.client.AMQP;
2020
import com.rabbitmq.client.AlreadyClosedException;
2121
import com.rabbitmq.client.test.BrokerTestCase;
22+
import com.rabbitmq.tools.Host;
2223

2324
import java.io.IOException;
2425

@@ -41,6 +42,18 @@ public void testInvalidUserId() {
4142
}
4243
}
4344

45+
public void testImpersonatedUserId() throws IOException {
46+
Host.rabbitmqctl("set_user_tags guest administrator impersonator");
47+
connection = null;
48+
channel = null;
49+
setUp();
50+
try {
51+
publish(BAD);
52+
} finally {
53+
Host.rabbitmqctl("set_user_tags guest administrator");
54+
}
55+
}
56+
4457
private void publish(AMQP.BasicProperties properties) throws IOException {
4558
channel.basicPublish("amq.fanout", "", properties, "".getBytes());
4659
channel.queueDeclare(); // To flush the channel

0 commit comments

Comments
 (0)