use of joynr.MulticastPublication in project joynr by bmwcarit.
the class DispatcherImplTest method testSendMulticastMessage.
@Test
public void testSendMulticastMessage() {
MutableMessageFactory messageFactoryMock = mock(MutableMessageFactory.class);
ObjectMapper objectMapperMock = mock(ObjectMapper.class);
fixture = new DispatcherImpl(requestReplyManagerMock, subscriptionManagerMock, publicationManagerMock, messageRouterMock, messageSenderMock, messageFactoryMock, objectMapperMock);
String fromParticipantId = "fromParticipantId";
MulticastPublication multicastPublication = mock(MulticastPublication.class);
MessagingQos messagingQos = mock(MessagingQos.class);
fixture.sendMulticast(fromParticipantId, multicastPublication, messagingQos);
verify(messageFactoryMock).createMulticast(eq(fromParticipantId), eq(multicastPublication), eq(messagingQos));
}
use of joynr.MulticastPublication in project joynr by bmwcarit.
the class MutableMessageFactoryTest method testCreateMulticastMessage.
@Test
public void testCreateMulticastMessage() {
String multicastId = "multicastId";
MulticastPublication multicastPublication = new MulticastPublication(Collections.emptyList(), multicastId);
MutableMessage joynrMessage = mutableMessageFactory.createMulticast(fromParticipantId, multicastPublication, messagingQos);
assertNotNull(joynrMessage);
assertExpiryDateEquals(expiryDate.getValue(), joynrMessage);
assertEquals(fromParticipantId, joynrMessage.getSender());
assertEquals(multicastId, joynrMessage.getRecipient());
assertEquals(Message.VALUE_MESSAGE_TYPE_MULTICAST, joynrMessage.getType());
assertTrue(new String(joynrMessage.getPayload(), Charsets.UTF_8).contains(MulticastPublication.class.getName()));
}
Aggregations