@Test public void testExecute() { GetReadOnlyStreamsDbMapper sut = new GetReadOnlyStreamsDbMapper(); sut.setEntityManager(getEntityManager()); List<Stream> streams = sut.execute(4L); assertEquals(3, streams.size()); boolean followingFound = false; boolean everyoneFound = false; boolean savedFound = false; for (Stream s : streams) { followingFound = followingFound || s.getName().equals("Following"); everyoneFound = everyoneFound || s.getName().equals("Everyone"); savedFound = everyoneFound || s.getName().equals("My saved items"); } assertTrue(followingFound); assertTrue(everyoneFound); assertTrue(savedFound); }
@Override public List<Stream> execute(final Long ignoredInput) { return getEntityManager().createQuery("FROM Stream WHERE readonly=:readonly").setParameter("readonly", true) .getResultList(); }
GetReadOnlyStreamsDbMapper extends BaseArgDomainMapper<Long, List<Stream>> { @Override public List<Stream> execute(final Long ignoredInput) { return getEntityManager().createQuery("FROM Stream WHERE readonly=:readonly").setParameter("readonly", true) .getResultList(); } }
GetReadOnlyStreamsDbMapper extends BaseArgDomainMapper<Long, List<Stream>> { @Override public List<Stream> execute(final Long ignoredInput) { return getEntityManager().createQuery("FROM Stream WHERE readonly=:readonly").setParameter("readonly", true) .getResultList(); }  }
GetReadOnlyStreamsDbMapper extends BaseArgDomainMapper<Long, List<Stream>> { @Override public List<Stream> execute(final Long ignoredInput) { return getEntityManager().createQuery("FROM Stream WHERE readonly=:readonly").setParameter("readonly", true) .getResultList(); }  @Override List<Stream> execute(final Long ignoredInput); }
GetReadOnlyStreamsDbMapper extends BaseArgDomainMapper<Long, List<Stream>> { @Override public List<Stream> execute(final Long ignoredInput) { return getEntityManager().createQuery("FROM Stream WHERE readonly=:readonly").setParameter("readonly", true) .getResultList(); }  @Override List<Stream> execute(final Long ignoredInput);  }