### Question:
AgathonSeedProvider implements SeedProvider { @Override public List<InetAddress> getSeeds() { try { return transform(connector.getSeeds(ringName)); } catch (ConfigurationException e) { throw Throwables.propagate(e); } } AgathonSeedProvider(Map<String, String> params); @VisibleForTesting  AgathonSeedProvider(AgathonConnector connector, String ringName, @Nullable InetAddress localAddress); @Override List<InetAddress> getSeeds();  }### Answer:
@Test public void getSeeds() throws Exception { InetAddress addr1 = createMock(InetAddress.class); InetAddress addr2 = createMock(InetAddress.class); InetAddress addr3 = createMock(InetAddress.class); expect(addr1.getHostAddress()).andReturn("123"); expect(addr2.getHostAddress()).andReturn("456"); expect(addr3.getHostAddress()).andReturn("789"); expect(connector.getSeeds(RING_NAME)).andReturn(ImmutableList.of(SEED1, SEED2, SEED3)); expect(provider.getInetAddress(SEED1)).andReturn(addr1); expect(provider.getInetAddress(SEED2)).andReturn(addr2); expect(provider.getInetAddress(SEED3)).andReturn(addr3); replay(connector, provider, addr1, addr2, addr3); assertEquals(ImmutableList.of(addr1, addr2, addr3), provider.getSeeds()); }
@Test public void getSeeds_configurationException() throws Exception { final ConfigurationException exception = new ConfigurationException("misconfigured"); expect(connector.getSeeds(RING_NAME)).andThrow(exception); replay(connector, provider); try { provider.getSeeds(); fail("Expected a RuntimeException"); } catch (RuntimeException e) { assertEquals(exception, e); } }