@Test public void testExecuteExpectingResults() { final Long fordId = 42L; final Long burnsId = 99L; List<Long> fordComments = sut.execute(fordId); assertEquals(4, fordComments.size()); assertEquals(new Long(4), fordComments.get(0)); assertEquals(new Long(5), fordComments.get(1)); assertEquals(new Long(7), fordComments.get(2)); assertEquals(new Long(8), fordComments.get(3)); List<Long> burnsComments = sut.execute(burnsId); assertEquals(5, burnsComments.size()); Collections.sort(burnsComments); assertEquals(new Long(1), burnsComments.get(0)); assertEquals(new Long(2), burnsComments.get(1)); assertEquals(new Long(3), burnsComments.get(2)); assertEquals(new Long(6), burnsComments.get(3)); }
@SuppressWarnings("unchecked") public List<Long> execute(final Long inAuthorPersonId) { return (List<Long>) getEntityManager().createQuery( "SELECT id FROM Comment WHERE author.id = :personId") .setParameter("personId", inAuthorPersonId).getResultList(); }
GetActivityCommentIdsAuthoredByPersonId extends BaseDomainMapper { @SuppressWarnings("unchecked") public List<Long> execute(final Long inAuthorPersonId) { return (List<Long>) getEntityManager().createQuery( "SELECT id FROM Comment WHERE author.id = :personId") .setParameter("personId", inAuthorPersonId).getResultList(); } }
GetActivityCommentIdsAuthoredByPersonId extends BaseDomainMapper { @SuppressWarnings("unchecked") public List<Long> execute(final Long inAuthorPersonId) { return (List<Long>) getEntityManager().createQuery( "SELECT id FROM Comment WHERE author.id = :personId") .setParameter("personId", inAuthorPersonId).getResultList(); }  }
GetActivityCommentIdsAuthoredByPersonId extends BaseDomainMapper { @SuppressWarnings("unchecked") public List<Long> execute(final Long inAuthorPersonId) { return (List<Long>) getEntityManager().createQuery( "SELECT id FROM Comment WHERE author.id = :personId") .setParameter("personId", inAuthorPersonId).getResultList(); }  @SuppressWarnings("unchecked") List<Long> execute(final Long inAuthorPersonId); }
GetActivityCommentIdsAuthoredByPersonId extends BaseDomainMapper { @SuppressWarnings("unchecked") public List<Long> execute(final Long inAuthorPersonId) { return (List<Long>) getEntityManager().createQuery( "SELECT id FROM Comment WHERE author.id = :personId") .setParameter("personId", inAuthorPersonId).getResultList(); }  @SuppressWarnings("unchecked") List<Long> execute(final Long inAuthorPersonId);  }