@Test public void test_should_save_messages() { List<org.egov.domain.model.Message> domainMessages = getDomainMessages(); final AuthenticatedUser user = new AuthenticatedUser(1L); messageRepository.save(domainMessages, user); verify(messageJpaRepository).save(anyListOf(Message.class)); }
public void save(List<Message> messages, AuthenticatedUser authenticatedUser) { final List<org.egov.persistence.entity.Message> entityMessages = messages.stream() .map(org.egov.persistence.entity.Message::new).collect(Collectors.toList()); setAuditFieldsForCreate(authenticatedUser, entityMessages); setUUID(entityMessages); log.info("entityMessages: "+entityMessages); try { messageJpaRepository.save(entityMessages); } catch (DataIntegrityViolationException ex) { new DataIntegrityViolationExceptionTransformer(ex).transform(); } }
MessageRepository { public void save(List<Message> messages, AuthenticatedUser authenticatedUser) { final List<org.egov.persistence.entity.Message> entityMessages = messages.stream() .map(org.egov.persistence.entity.Message::new).collect(Collectors.toList()); setAuditFieldsForCreate(authenticatedUser, entityMessages); setUUID(entityMessages); log.info("entityMessages: "+entityMessages); try { messageJpaRepository.save(entityMessages); } catch (DataIntegrityViolationException ex) { new DataIntegrityViolationExceptionTransformer(ex).transform(); } } }
MessageRepository { public void save(List<Message> messages, AuthenticatedUser authenticatedUser) { final List<org.egov.persistence.entity.Message> entityMessages = messages.stream() .map(org.egov.persistence.entity.Message::new).collect(Collectors.toList()); setAuditFieldsForCreate(authenticatedUser, entityMessages); setUUID(entityMessages); log.info("entityMessages: "+entityMessages); try { messageJpaRepository.save(entityMessages); } catch (DataIntegrityViolationException ex) { new DataIntegrityViolationExceptionTransformer(ex).transform(); } } MessageRepository(MessageJpaRepository messageJpaRepository); }
MessageRepository { public void save(List<Message> messages, AuthenticatedUser authenticatedUser) { final List<org.egov.persistence.entity.Message> entityMessages = messages.stream() .map(org.egov.persistence.entity.Message::new).collect(Collectors.toList()); setAuditFieldsForCreate(authenticatedUser, entityMessages); setUUID(entityMessages); log.info("entityMessages: "+entityMessages); try { messageJpaRepository.save(entityMessages); } catch (DataIntegrityViolationException ex) { new DataIntegrityViolationExceptionTransformer(ex).transform(); } } MessageRepository(MessageJpaRepository messageJpaRepository); List<Message> findByTenantIdAndLocale(Tenant tenant, String locale); List<Message> findAllMessage(Tenant tenant, String locale, String module, String code); void setUUID(List<org.egov.persistence.entity.Message> entityMessages); void save(List<Message> messages, AuthenticatedUser authenticatedUser); void delete(String tenant, String locale, String module, List<String> codes); void update(String tenant, String locale, String module, List<Message> domainMessages,
			AuthenticatedUser authenticatedUser); void upsert(String tenant, String locale, String module, List<Message> domainMessages,
			AuthenticatedUser authenticatedUser); }
MessageRepository { public void save(List<Message> messages, AuthenticatedUser authenticatedUser) { final List<org.egov.persistence.entity.Message> entityMessages = messages.stream() .map(org.egov.persistence.entity.Message::new).collect(Collectors.toList()); setAuditFieldsForCreate(authenticatedUser, entityMessages); setUUID(entityMessages); log.info("entityMessages: "+entityMessages); try { messageJpaRepository.save(entityMessages); } catch (DataIntegrityViolationException ex) { new DataIntegrityViolationExceptionTransformer(ex).transform(); } } MessageRepository(MessageJpaRepository messageJpaRepository); List<Message> findByTenantIdAndLocale(Tenant tenant, String locale); List<Message> findAllMessage(Tenant tenant, String locale, String module, String code); void setUUID(List<org.egov.persistence.entity.Message> entityMessages); void save(List<Message> messages, AuthenticatedUser authenticatedUser); void delete(String tenant, String locale, String module, List<String> codes); void update(String tenant, String locale, String module, List<Message> domainMessages,
			AuthenticatedUser authenticatedUser); void upsert(String tenant, String locale, String module, List<Message> domainMessages,
			AuthenticatedUser authenticatedUser);  }