@Test public void findAll() throws Exception { CassandraInstance instance1 = createMock(CassandraInstance.class); CassandraInstance instance2 = createMock(CassandraInstance.class); CassandraInstance instance3 = createMock(CassandraInstance.class); ImmutableSet<CassandraInstance> instances = ImmutableSet.of(instance1, instance2, instance3); expect(dao.findAll(RING_NAME)).andReturn(instances); replayAll(); assertEquals(instances, service.findAll(RING_NAME)); }
@Override public ImmutableSet<CassandraInstance> findAll(String ring) { try { return dao.findAll(ring); } catch (BackingStoreException e) { throw new ServiceUnavailableException(e); } }
CassandraInstanceServiceImpl implements CassandraInstanceService { @Override public ImmutableSet<CassandraInstance> findAll(String ring) { try { return dao.findAll(ring); } catch (BackingStoreException e) { throw new ServiceUnavailableException(e); } } }
CassandraInstanceServiceImpl implements CassandraInstanceService { @Override public ImmutableSet<CassandraInstance> findAll(String ring) { try { return dao.findAll(ring); } catch (BackingStoreException e) { throw new ServiceUnavailableException(e); } } @Inject  CassandraInstanceServiceImpl(CassandraInstanceDao dao); }
CassandraInstanceServiceImpl implements CassandraInstanceService { @Override public ImmutableSet<CassandraInstance> findAll(String ring) { try { return dao.findAll(ring); } catch (BackingStoreException e) { throw new ServiceUnavailableException(e); } } @Inject  CassandraInstanceServiceImpl(CassandraInstanceDao dao); @Override ImmutableSet<CassandraInstance> findAll(String ring); @Override @Nullable CassandraInstance findById(String ring, int id); @Override void save(String ring, CassandraInstance instance); @Override void delete(String ring, CassandraInstance instance); }
CassandraInstanceServiceImpl implements CassandraInstanceService { @Override public ImmutableSet<CassandraInstance> findAll(String ring) { try { return dao.findAll(ring); } catch (BackingStoreException e) { throw new ServiceUnavailableException(e); } } @Inject  CassandraInstanceServiceImpl(CassandraInstanceDao dao); @Override ImmutableSet<CassandraInstance> findAll(String ring); @Override @Nullable CassandraInstance findById(String ring, int id); @Override void save(String ring, CassandraInstance instance); @Override void delete(String ring, CassandraInstance instance);  }