Added username to all messages. From a consumer perspective the username is more useful than a clientID which is often autogenerated.

This commit is contained in:
Dee Eldredge
2016-03-23 23:10:24 +01:00
committed by andsel
parent f44283d5f0
commit 7dab8a367f
9 changed files with 183 additions and 181 deletions
@@ -97,28 +97,28 @@ public class BrokerInterceptorTest {
@Test
public void testNotifyClientDisconnected() throws Exception {
interceptor.notifyClientDisconnected("cli1234");
interceptor.notifyClientDisconnected("cli1234","cli1234");
interval();
assertEquals(50, n.get());
}
@Test
public void testNotifyTopicPublished() throws Exception {
interceptor.notifyTopicPublished(new PublishMessage(), "cli1234");
interceptor.notifyTopicPublished(new PublishMessage(), "cli1234", "cli1234");
interval();
assertEquals(60, n.get());
}
@Test
public void testNotifyTopicSubscribed() throws Exception {
interceptor.notifyTopicSubscribed(new Subscription("cli1", "o2", AbstractMessage.QOSType.MOST_ONE));
interceptor.notifyTopicSubscribed(new Subscription("cli1", "o2", AbstractMessage.QOSType.MOST_ONE), "cli1234");
interval();
assertEquals(70, n.get());
}
@Test
public void testNotifyTopicUnsubscribed() throws Exception {
interceptor.notifyTopicUnsubscribed("o2", "cli1234");
interceptor.notifyTopicUnsubscribed("o2", "cli1234", "cli1234");
interval();
assertEquals(80, n.get());
}