SubscriptionDelegate { public Subscription getSubscription(NotificationSubscriptionContext subscriptionContext) { Publisher publisher = getPublisher(subscriptionContext); Subscriber subscriber = getSubscriber(subscriptionContext.getIdentity()); return subscriptionDao.getSubscription(subscriber, publisher); }  void invalidateSubscriptionForSubscriptionContext(NotificationSubscriptionContext subscriptionContext); void invalidateSubscription(Publisher publisher, Subscriber subscriber); void invalidateSubscription(Subscription subscription); Subscription getSubscription(NotificationSubscriptionContext subscriptionContext); Subscription createAndSaveSubscription(NotificationSubscriptionContext subscriptionContext); List<Subscription> getSubscriptions(Identity identity);  }
@Test public void getSubscription() { when(subscriptionDelegateTestObject.subscriptionDao.getSubscription(subscriber, publisher)).thenReturn(subscription); Subscription returnSubscription = subscriptionDelegateTestObject.getSubscription(subscriptionContext); assertEquals("getSubscription returns wrong subscription", subscription, returnSubscription); }