### Question:
MonitoringNotificationDao extends NamedParameterJdbcDaoSupport { @Transactional(propagation = Propagation.MANDATORY) public void createMonitoringNotifications(List<NotificationMessage> notificationMessages) { List<Long> ids = daoHelper.createIds(notificationQueueSequence, notificationMessages.size()); MapSqlParameterSource[] params = IntStream.range(0, notificationMessages.size()) .mapToObj(i -> { NotificationMessage message = notificationMessages.get(i); message.setId(ids.get(i)); return MonitoringNotificationParameters.getParameters(message); }) .toArray(MapSqlParameterSource[]::new); getNamedParameterJdbcTemplate().batchUpdate(createMonitoringNotificationQuery, params); }  @Transactional(propagation = Propagation.MANDATORY) void createMonitoringNotification(NotificationMessage notificationMessage); @Transactional(propagation = Propagation.MANDATORY) void createMonitoringNotifications(List<NotificationMessage> notificationMessages); @Transactional(propagation = Propagation.SUPPORTS) NotificationMessage loadMonitoringNotification(Long id); List<NotificationMessage> loadAllNotifications(); @Transactional(propagation = Propagation.MANDATORY) void deleteNotificationsByTemplateId(long templateId); @Transactional(propagation = Propagation.MANDATORY) void updateNotificationTimestamp(final List<Long> ids, final NotificationType notificationType); @Transactional(propagation = Propagation.MANDATORY) Optional<NotificationTimestamp> loadNotificationTimestamp(final Long runId, final NotificationType type); @Transactional(propagation = Propagation.MANDATORY) void deleteNotificationTimestampsForRun(final Long runId); @Transactional(propagation = Propagation.MANDATORY) void deleteNotificationTimestampsForPipeline(final Long pipelineId); @Transactional(propagation = Propagation.MANDATORY) void deleteNotificationsForUser(final Long userId); @Required void setNotificationQueueSequence(String notificationQueueSequence); @Required void setCreateMonitoringNotificationQuery(String createMonitoringNotificationQuery); @Required void setLoadMonitoringNotificationQuery(String loadMonitoringNotificationQuery); @Required void setDeleteNotificationsByTemplateIdQuery(String deleteNotificationsByTemplateIdQuery); @Required void setLoadAllMonitoringNotificationsQuery(String loadAllMonitoringNotificationsQuery); @Required void setUpdateNotificationTimestampQuery(String updateNotificationTimestampQuery); @Required void setLoadNotificationTimestampQuery(String loadNotificationTimestampQuery); @Required void setDeleteNotificationTimestampsByRunIdQuery(String deleteNotificationTimestampsByRunIdQuery); @Required void setDeleteNotificationTimestampsByPipelineIdQuery(String deleteNotificationTimestampsByPipelineIdQuery); @Required void setDeleteNotificationsByUserIdQuery(final String deleteNotificationsByUserIdQuery);  }### Answer:
@Test public void testCreateMonitoringNotifications() { NotificationTemplate notificationTemplate = notificationTemplateDao.createNotificationTemplate(template); PipelineUser pipelineUser = userDao.loadUserByName(TEST_USER1); List<NotificationMessage> messages = IntStream.range(0, 5).mapToObj(i -> { NotificationMessage notificationMessage = new NotificationMessage(); notificationMessage.setTemplate(notificationTemplate); notificationMessage.setToUserId(pipelineUser.getId()); notificationMessage.setCopyUserIds(Collections.singletonList(pipelineUser.getId())); notificationMessage.setTemplateParameters(Collections.singletonMap("test", i)); return notificationMessage; }).collect(Collectors.toList()); monitoringNotificationDao.createMonitoringNotifications(messages); List<NotificationMessage> loaded = monitoringNotificationDao.loadAllNotifications(); assertTrue(messages.size() <= loaded.size()); assertTrue(loaded.stream() .allMatch(l -> messages.stream() .anyMatch(m -> m.getTemplateParameters().equals(l.getTemplateParameters())))); }