use of org.eclipse.scout.rt.server.clientnotification.ClientNotificationClusterNotification in project scout.rt by eclipse.
the class ClientNotificationClusterNotificationTest method testClientNotificationsReceived.
/**
* Tests that the client notifications are added to the queue when received
*/
@SuppressWarnings("unchecked")
@Test
public void testClientNotificationsReceived() {
IMessage<IClusterNotificationMessage> momMsg = mock(IMessage.class);
ClientNotificationAddress address = ClientNotificationAddress.createAllNodesAddress();
ClientNotificationMessage message = new ClientNotificationMessage(address, "test", true, "cid");
ArrayList<ClientNotificationMessage> messages = new ArrayList<ClientNotificationMessage>();
messages.add(message);
when(momMsg.getTransferObject()).thenReturn(new ClusterNotificationMessage(new ClientNotificationClusterNotification(messages), m_testProps));
m_svc.onMessage(momMsg);
IClientNotificationService c = BEANS.get(IClientNotificationService.class);
List<ClientNotificationMessage> notifications = c.getNotifications(TEST_NODE);
assertEquals(1, notifications.size());
}
Aggregations