@Test public void findById() throws Exception { CassandraInstance instance = createMock(CassandraInstance.class); expect(dao.findById(RING_NAME, CASSANDRA_ID)).andReturn(instance); replayAll(); assertEquals(instance, service.findById(RING_NAME, CASSANDRA_ID)); }
@Override public @Nullable CassandraInstance findById(String ring, int id) { try { return dao.findById(ring, id); } catch (BackingStoreException e) { throw new ServiceUnavailableException(e); } }
CassandraInstanceServiceImpl implements CassandraInstanceService { @Override public @Nullable CassandraInstance findById(String ring, int id) { try { return dao.findById(ring, id); } catch (BackingStoreException e) { throw new ServiceUnavailableException(e); } } }
CassandraInstanceServiceImpl implements CassandraInstanceService { @Override public @Nullable CassandraInstance findById(String ring, int id) { try { return dao.findById(ring, id); } catch (BackingStoreException e) { throw new ServiceUnavailableException(e); } } @Inject  CassandraInstanceServiceImpl(CassandraInstanceDao dao); }
CassandraInstanceServiceImpl implements CassandraInstanceService { @Override public @Nullable CassandraInstance findById(String ring, int id) { try { return dao.findById(ring, id); } 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 @Nullable CassandraInstance findById(String ring, int id) { try { return dao.findById(ring, id); } 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);  }