@Test public void testGetAdministrativeNotifications() throws Exception { final AdministrativeNotification notification = new AdministrativeNotification(); service.setAdministrativeNotificationProducers(Arrays.<AdministrativeNotificationProducer>asList( new AdministrativeNotificationProducer() { @Override public List<AdministrativeNotification> generateNotifications() { return Arrays.asList(notification); } })); List<AdministrativeNotification> notifications = service.getAdministrativeNotifications(); assertThat(notifications.size(), is(1)); assertThat(notifications.get(0), is(notification)); }
@Override public List<AdministrativeNotification> getAdministrativeNotifications() { List<AdministrativeNotification> ret = new ArrayList<AdministrativeNotification>(); if (administrativeNotificationProducers != null) { for (AdministrativeNotificationProducer producer : administrativeNotificationProducers) { List<AdministrativeNotification> notifications = producer.generateNotifications(); if (notifications != null) { ret.addAll(notifications); } } } return ret; }
AdministrativeNotificationServiceImpl extends BaseOpenmrsService implements AdministrativeNotificationService { @Override public List<AdministrativeNotification> getAdministrativeNotifications() { List<AdministrativeNotification> ret = new ArrayList<AdministrativeNotification>(); if (administrativeNotificationProducers != null) { for (AdministrativeNotificationProducer producer : administrativeNotificationProducers) { List<AdministrativeNotification> notifications = producer.generateNotifications(); if (notifications != null) { ret.addAll(notifications); } } } return ret; } }
AdministrativeNotificationServiceImpl extends BaseOpenmrsService implements AdministrativeNotificationService { @Override public List<AdministrativeNotification> getAdministrativeNotifications() { List<AdministrativeNotification> ret = new ArrayList<AdministrativeNotification>(); if (administrativeNotificationProducers != null) { for (AdministrativeNotificationProducer producer : administrativeNotificationProducers) { List<AdministrativeNotification> notifications = producer.generateNotifications(); if (notifications != null) { ret.addAll(notifications); } } } return ret; }  }
AdministrativeNotificationServiceImpl extends BaseOpenmrsService implements AdministrativeNotificationService { @Override public List<AdministrativeNotification> getAdministrativeNotifications() { List<AdministrativeNotification> ret = new ArrayList<AdministrativeNotification>(); if (administrativeNotificationProducers != null) { for (AdministrativeNotificationProducer producer : administrativeNotificationProducers) { List<AdministrativeNotification> notifications = producer.generateNotifications(); if (notifications != null) { ret.addAll(notifications); } } } return ret; }  @Override List<AdministrativeNotification> getAdministrativeNotifications(); void setAdministrativeNotificationProducers(List<AdministrativeNotificationProducer> administrativeNotificationProducers); }
AdministrativeNotificationServiceImpl extends BaseOpenmrsService implements AdministrativeNotificationService { @Override public List<AdministrativeNotification> getAdministrativeNotifications() { List<AdministrativeNotification> ret = new ArrayList<AdministrativeNotification>(); if (administrativeNotificationProducers != null) { for (AdministrativeNotificationProducer producer : administrativeNotificationProducers) { List<AdministrativeNotification> notifications = producer.generateNotifications(); if (notifications != null) { ret.addAll(notifications); } } } return ret; }  @Override List<AdministrativeNotification> getAdministrativeNotifications(); void setAdministrativeNotificationProducers(List<AdministrativeNotificationProducer> administrativeNotificationProducers);  }