@Test public void findAll() throws Exception { CassandraRing ring1 = createMock(CassandraRing.class); CassandraRing ring2 = createMock(CassandraRing.class); CassandraRing ring3 = createMock(CassandraRing.class); ImmutableSet<CassandraRing> rings = ImmutableSet.of(ring1, ring2, ring3); expect(dao.findAll()).andReturn(rings); replayAll(); assertEquals(rings, service.findAll()); }
@Override public ImmutableSet<CassandraRing> findAll() { try { return dao.findAll(); } catch (BackingStoreException e) { throw new ServiceUnavailableException(e); } }
CassandraRingServiceImpl implements CassandraRingService { @Override public ImmutableSet<CassandraRing> findAll() { try { return dao.findAll(); } catch (BackingStoreException e) { throw new ServiceUnavailableException(e); } } }
CassandraRingServiceImpl implements CassandraRingService { @Override public ImmutableSet<CassandraRing> findAll() { try { return dao.findAll(); } catch (BackingStoreException e) { throw new ServiceUnavailableException(e); } } @Inject  CassandraRingServiceImpl(CassandraRingDao dao); }
CassandraRingServiceImpl implements CassandraRingService { @Override public ImmutableSet<CassandraRing> findAll() { try { return dao.findAll(); } catch (BackingStoreException e) { throw new ServiceUnavailableException(e); } } @Inject  CassandraRingServiceImpl(CassandraRingDao dao); @Override ImmutableSet<CassandraRing> findAll(); @Override CassandraRing findByName(String name); @Override void save(CassandraRing ring); @Override void delete(CassandraRing ring); }
CassandraRingServiceImpl implements CassandraRingService { @Override public ImmutableSet<CassandraRing> findAll() { try { return dao.findAll(); } catch (BackingStoreException e) { throw new ServiceUnavailableException(e); } } @Inject  CassandraRingServiceImpl(CassandraRingDao dao); @Override ImmutableSet<CassandraRing> findAll(); @Override CassandraRing findByName(String name); @Override void save(CassandraRing ring); @Override void delete(CassandraRing ring);  }