// Path: app/src/main/java/de/codecentric/dao/impl/JpaCommentDao.java
// @Repository("commentDao")
// @Transactional
// public class JpaCommentDao implements CommentDao {
// 
//     @PersistenceContext
//     private EntityManager em;
// 
//     public JpaCommentDao() {
//     }
// 
//     // test constructor
//     public JpaCommentDao(EntityManager em) {
//         this.em = em;
//     }
// 
//     @SuppressWarnings("unchecked")
//     public List<Comment> getCommentsBySessionId(Long sessionId) {
//         Query query = em.createNamedQuery("findCommentForSession");
//         return query.setParameter("sessionId", sessionId).getResultList();
//     }
// 
//     public List<TimelineEntry> getRecentComments() {
//         List<TimelineEntry> result = new ArrayList<TimelineEntry>();
// 
//         @SuppressWarnings("unchecked")
//         List<Object[]> resultList = em.createNamedQuery("findRecentComments").setMaxResults(25).getResultList();
// 
//         for (Object[] entry : resultList) {
//             result.add(new TimelineEntry(entry[0] != null ? entry[0].toString() : "", entry[0] != null ? entry[1].toString() : "", entry[0] != null ? entry[2].toString() : "",
//                             entry[0] != null ? entry[3].toString() : "", entry[0] != null ? entry[4].toString() : ""));
//         }
// 
//         return result;
//     }
// 
//     public void saveComment(Comment comment) {
//         em.merge(comment);
//     }
// 
// }


import static org.mockito.Mockito.verify;
import java.util.Date;
import javax.persistence.EntityManager;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import de.codecentric.dao.impl.JpaCommentDao;

package de.codecentric.domain;






public class JpaCommentDaoTest {

    @Mock
    private EntityManager emMock;

// Path: app/src/main/java/de/codecentric/dao/impl/JpaCommentDao.java
// @Repository("commentDao")
// @Transactional
// public class JpaCommentDao implements CommentDao {
// 
//     @PersistenceContext
//     private EntityManager em;
// 
//     public JpaCommentDao() {
//     }
// 
//     // test constructor
//     public JpaCommentDao(EntityManager em) {
//         this.em = em;
//     }
// 
//     @SuppressWarnings("unchecked")
//     public List<Comment> getCommentsBySessionId(Long sessionId) {
//         Query query = em.createNamedQuery("findCommentForSession");
//         return query.setParameter("sessionId", sessionId).getResultList();
//     }
// 
//     public List<TimelineEntry> getRecentComments() {
//         List<TimelineEntry> result = new ArrayList<TimelineEntry>();
// 
//         @SuppressWarnings("unchecked")
//         List<Object[]> resultList = em.createNamedQuery("findRecentComments").setMaxResults(25).getResultList();
// 
//         for (Object[] entry : resultList) {
//             result.add(new TimelineEntry(entry[0] != null ? entry[0].toString() : "", entry[0] != null ? entry[1].toString() : "", entry[0] != null ? entry[2].toString() : "",
//                             entry[0] != null ? entry[3].toString() : "", entry[0] != null ? entry[4].toString() : ""));
//         }
// 
//         return result;
//     }
// 
//     public void saveComment(Comment comment) {
//         em.merge(comment);
//     }
// 
// }


// Path: app/src/test/java/de/codecentric/domain/JpaCommentDaoTest.java
import static org.mockito.Mockito.verify;
import java.util.Date;
import javax.persistence.EntityManager;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import de.codecentric.dao.impl.JpaCommentDao;

package de.codecentric.domain;






public class JpaCommentDaoTest {

    @Mock
    private EntityManager emMock;

    private JpaCommentDao dao;
