@Test public void withMocks() throws Exception { expect(mock.getValueFromTheInternet("yo")).andReturn("mama"); replay(mock); assertThat(cut.getValueFromTheInternet("yo")).isEqualTo("delayed=mama"); verify(mock); }
@Override public String getValueFromTheInternet(String id) { sleepFiveSecondsIfUserIsYo(id); return "delayed=" + inner.getValueFromTheInternet(id); }
SomeDelayedClient implements Client { @Override public String getValueFromTheInternet(String id) { sleepFiveSecondsIfUserIsYo(id); return "delayed=" + inner.getValueFromTheInternet(id); } }
SomeDelayedClient implements Client { @Override public String getValueFromTheInternet(String id) { sleepFiveSecondsIfUserIsYo(id); return "delayed=" + inner.getValueFromTheInternet(id); }  }
SomeDelayedClient implements Client { @Override public String getValueFromTheInternet(String id) { sleepFiveSecondsIfUserIsYo(id); return "delayed=" + inner.getValueFromTheInternet(id); }  @Override String getValueFromTheInternet(String id); }
SomeDelayedClient implements Client { @Override public String getValueFromTheInternet(String id) { sleepFiveSecondsIfUserIsYo(id); return "delayed=" + inner.getValueFromTheInternet(id); }  @Override String getValueFromTheInternet(String id);  }