@Test(expected = BackingStoreException.class) public void findById_backingStoreException() throws Exception { expect(zergConnector.getHosts()).andThrow(new BackingStoreException()); replayAll(); dao.findByName(BIG_RING); }
@Override public @Nullable CassandraRing findByName(String name) throws BackingStoreException { ZergHosts hosts = ZergHosts.from(zergConnector.getHosts()); if (!hosts.rings().contains(name)) { return null; } return buildRingFromHosts(name, hosts); }
ZergCassandraRingDao implements CassandraRingDao { @Override public @Nullable CassandraRing findByName(String name) throws BackingStoreException { ZergHosts hosts = ZergHosts.from(zergConnector.getHosts()); if (!hosts.rings().contains(name)) { return null; } return buildRingFromHosts(name, hosts); } }
ZergCassandraRingDao implements CassandraRingDao { @Override public @Nullable CassandraRing findByName(String name) throws BackingStoreException { ZergHosts hosts = ZergHosts.from(zergConnector.getHosts()); if (!hosts.rings().contains(name)) { return null; } return buildRingFromHosts(name, hosts); } @Inject  ZergCassandraRingDao(ZergConnector zergConnector,
      @Named(ZergDaoModule.ZERG_REGION_PROPERTY) String currentRegion,
      @Named(ZergDaoModule.ZERG_CASSANDRA_RING_SCOPES) Map<String, String> ringScopes); }
ZergCassandraRingDao implements CassandraRingDao { @Override public @Nullable CassandraRing findByName(String name) throws BackingStoreException { ZergHosts hosts = ZergHosts.from(zergConnector.getHosts()); if (!hosts.rings().contains(name)) { return null; } return buildRingFromHosts(name, hosts); } @Inject  ZergCassandraRingDao(ZergConnector zergConnector,
      @Named(ZergDaoModule.ZERG_REGION_PROPERTY) String currentRegion,
      @Named(ZergDaoModule.ZERG_CASSANDRA_RING_SCOPES) Map<String, String> ringScopes); @Override ImmutableSet<CassandraRing> findAll(); @Override @Nullable CassandraRing findByName(String name); @Override void save(CassandraRing ring); @Override void delete(CassandraRing ring); }
ZergCassandraRingDao implements CassandraRingDao { @Override public @Nullable CassandraRing findByName(String name) throws BackingStoreException { ZergHosts hosts = ZergHosts.from(zergConnector.getHosts()); if (!hosts.rings().contains(name)) { return null; } return buildRingFromHosts(name, hosts); } @Inject  ZergCassandraRingDao(ZergConnector zergConnector,
      @Named(ZergDaoModule.ZERG_REGION_PROPERTY) String currentRegion,
      @Named(ZergDaoModule.ZERG_CASSANDRA_RING_SCOPES) Map<String, String> ringScopes); @Override ImmutableSet<CassandraRing> findAll(); @Override @Nullable CassandraRing findByName(String name); @Override void save(CassandraRing ring); @Override void delete(CassandraRing ring);  }