use of joynr.SubscriptionReply in project joynr by bmwcarit.
the class TtlUpliftTest method testTtlUpliftMs_SubscriptionReply.
@Test
public void testTtlUpliftMs_SubscriptionReply() {
SubscriptionReply subscriptionReply = new SubscriptionReply();
expiryDate = DispatcherUtils.convertTtlToExpirationDate(messagingQos.getRoundTripTtl_ms());
MutableMessage message = messageFactoryWithTtlUplift.createSubscriptionReply(fromParticipantId, toParticipantId, subscriptionReply, messagingQos);
long expiryDateValue = expiryDate.getValue() + TTL_UPLIFT_MS;
MutableMessageFactoryTest.assertExpiryDateEquals(expiryDateValue, message);
}
use of joynr.SubscriptionReply in project joynr by bmwcarit.
the class SubscriptionManagerTest method testHandleSubscriptionReplyWithSuccessWithSubscriptionListener.
@Test
public void testHandleSubscriptionReplyWithSuccessWithSubscriptionListener() {
SubscriptionReply subscriptionReply = new SubscriptionReply(subscriptionId);
@SuppressWarnings("unchecked") Future<String> futureMock = mock(Future.class);
subscriptionFutureMap.put(subscriptionId, futureMock);
AttributeSubscriptionListener<?> subscriptionListener = mock(AttributeSubscriptionListener.class);
attributeSubscriptionDirectory.put(subscriptionId, subscriptionListener);
subscriptionManager.handleSubscriptionReply(subscriptionReply);
verify(futureMock).onSuccess(eq(subscriptionId));
verify(subscriptionListener).onSubscribed(eq(subscriptionId));
}
use of joynr.SubscriptionReply in project joynr by bmwcarit.
the class SubscriptionManagerTest method testHandleSubscriptionReplyWithSuccess.
@Test
public void testHandleSubscriptionReplyWithSuccess() {
SubscriptionReply subscriptionReply = new SubscriptionReply(subscriptionId);
@SuppressWarnings("unchecked") Future<String> futureMock = mock(Future.class);
subscriptionFutureMap.put(subscriptionId, futureMock);
subscriptionManager.handleSubscriptionReply(subscriptionReply);
verify(futureMock).onSuccess(eq(subscriptionId));
}
use of joynr.SubscriptionReply in project joynr by bmwcarit.
the class SubscriptionManagerTest method testHandleSubscriptionReplyWithError.
@Test
public void testHandleSubscriptionReplyWithError() {
SubscriptionException subscriptionError = new SubscriptionException(subscriptionId);
SubscriptionReply subscriptionReply = new SubscriptionReply(subscriptionId, subscriptionError);
@SuppressWarnings("unchecked") Future<String> futureMock = mock(Future.class);
subscriptionFutureMap.put(subscriptionId, futureMock);
subscriptionManager.handleSubscriptionReply(subscriptionReply);
verify(futureMock).onFailure(eq(subscriptionError));
}
Aggregations