@Test public void removeInvalidContexts_5_InvalidContextsFound() { when(okCourseMock.getAccess()).thenReturn(RepositoryEntry.ACC_OWNERS_AUTHORS); Set<Long> invalidContextsIds = notificationCourseAccessManager.removeInvalidContexts(subscriberIds); assertEquals(5, invalidContextsIds.size()); assertTrue(invalidContextsIds.contains(contextId_privateCourse1)); assertTrue(invalidContextsIds.contains(contextId_ok)); }
Set<Long> removeInvalidContexts(List<Long> subscriberIds) { log.debug("removeInvalidContexts started"); Set<Long> unaccessibleCourseIds = new HashSet<Long>(); for (Long subscriberId : subscriberIds) { List<NotificationSubscriptionContext> notificationCourseAccessTOs = notificationLearnServiceImpl.getNotificationSubscriptionContexts(subscriberId); Set<Long> subscribedCourseIds = getSubscribedCourseIds(notificationCourseAccessTOs); addUnaccessibleCourseIds(subscribedCourseIds, unaccessibleCourseIds); notificationLearnServiceImpl.removePublishers(unaccessibleCourseIds); } log.debug("removeInvalidContexts finished"); return unaccessibleCourseIds; }
NotificationCourseAccessManager implements CourseAccessManager { Set<Long> removeInvalidContexts(List<Long> subscriberIds) { log.debug("removeInvalidContexts started"); Set<Long> unaccessibleCourseIds = new HashSet<Long>(); for (Long subscriberId : subscriberIds) { List<NotificationSubscriptionContext> notificationCourseAccessTOs = notificationLearnServiceImpl.getNotificationSubscriptionContexts(subscriberId); Set<Long> subscribedCourseIds = getSubscribedCourseIds(notificationCourseAccessTOs); addUnaccessibleCourseIds(subscribedCourseIds, unaccessibleCourseIds); notificationLearnServiceImpl.removePublishers(unaccessibleCourseIds); } log.debug("removeInvalidContexts finished"); return unaccessibleCourseIds; } }
NotificationCourseAccessManager implements CourseAccessManager { Set<Long> removeInvalidContexts(List<Long> subscriberIds) { log.debug("removeInvalidContexts started"); Set<Long> unaccessibleCourseIds = new HashSet<Long>(); for (Long subscriberId : subscriberIds) { List<NotificationSubscriptionContext> notificationCourseAccessTOs = notificationLearnServiceImpl.getNotificationSubscriptionContexts(subscriberId); Set<Long> subscribedCourseIds = getSubscribedCourseIds(notificationCourseAccessTOs); addUnaccessibleCourseIds(subscribedCourseIds, unaccessibleCourseIds); notificationLearnServiceImpl.removePublishers(unaccessibleCourseIds); } log.debug("removeInvalidContexts finished"); return unaccessibleCourseIds; }  }
NotificationCourseAccessManager implements CourseAccessManager { Set<Long> removeInvalidContexts(List<Long> subscriberIds) { log.debug("removeInvalidContexts started"); Set<Long> unaccessibleCourseIds = new HashSet<Long>(); for (Long subscriberId : subscriberIds) { List<NotificationSubscriptionContext> notificationCourseAccessTOs = notificationLearnServiceImpl.getNotificationSubscriptionContexts(subscriberId); Set<Long> subscribedCourseIds = getSubscribedCourseIds(notificationCourseAccessTOs); addUnaccessibleCourseIds(subscribedCourseIds, unaccessibleCourseIds); notificationLearnServiceImpl.removePublishers(unaccessibleCourseIds); } log.debug("removeInvalidContexts finished"); return unaccessibleCourseIds; }  @Override void execute(); }
NotificationCourseAccessManager implements CourseAccessManager { Set<Long> removeInvalidContexts(List<Long> subscriberIds) { log.debug("removeInvalidContexts started"); Set<Long> unaccessibleCourseIds = new HashSet<Long>(); for (Long subscriberId : subscriberIds) { List<NotificationSubscriptionContext> notificationCourseAccessTOs = notificationLearnServiceImpl.getNotificationSubscriptionContexts(subscriberId); Set<Long> subscribedCourseIds = getSubscribedCourseIds(notificationCourseAccessTOs); addUnaccessibleCourseIds(subscribedCourseIds, unaccessibleCourseIds); notificationLearnServiceImpl.removePublishers(unaccessibleCourseIds); } log.debug("removeInvalidContexts finished"); return unaccessibleCourseIds; }  @Override void execute();  }