@Test public void testOnNewDataItem() { new Expectations(notificationManager) {{ senderCache.get(source, httpClient); result = httpSender; notificationManager.getAll(source); result = Arrays.asList(httpClient, gcmClient); }}; final ObjectNode data = new ObjectNode(JsonNodeFactory.instance); data.put("hello", "world"); notificationManager.onNewDataItem(source, data); new Verifications() {{ httpSender.onNewDataItem(data); gcmSender.onNewDataItem(data); }}; }
@Override public void onNewDataItem(DataSource source, ObjectNode data) { for (Client client : getAll(source)) { senderCache.get(source, client).onNewDataItem(data); } }
NotificationManager extends AbstractDataSourcePropertyManager<Client, NotificationClientRepository> implements DataSink { @Override public void onNewDataItem(DataSource source, ObjectNode data) { for (Client client : getAll(source)) { senderCache.get(source, client).onNewDataItem(data); } } }
NotificationManager extends AbstractDataSourcePropertyManager<Client, NotificationClientRepository> implements DataSink { @Override public void onNewDataItem(DataSource source, ObjectNode data) { for (Client client : getAll(source)) { senderCache.get(source, client).onNewDataItem(data); } } @Inject  NotificationManager(
			Cache<NotificationClientRepository> repositoryCache,
			RepositoryFactory repositoryFactory,
			SenderCache senderCache); }
NotificationManager extends AbstractDataSourcePropertyManager<Client, NotificationClientRepository> implements DataSink { @Override public void onNewDataItem(DataSource source, ObjectNode data) { for (Client client : getAll(source)) { senderCache.get(source, client).onNewDataItem(data); } } @Inject  NotificationManager(
			Cache<NotificationClientRepository> repositoryCache,
			RepositoryFactory repositoryFactory,
			SenderCache senderCache); @Override void onNewDataStart(DataSource source); @Override void onNewDataItem(DataSource source, ObjectNode data); @Override void onNewDataComplete(DataSource source); }
NotificationManager extends AbstractDataSourcePropertyManager<Client, NotificationClientRepository> implements DataSink { @Override public void onNewDataItem(DataSource source, ObjectNode data) { for (Client client : getAll(source)) { senderCache.get(source, client).onNewDataItem(data); } } @Inject  NotificationManager(
			Cache<NotificationClientRepository> repositoryCache,
			RepositoryFactory repositoryFactory,
			SenderCache senderCache); @Override void onNewDataStart(DataSource source); @Override void onNewDataItem(DataSource source, ObjectNode data); @Override void onNewDataComplete(DataSource source);  }