/** * @see Component */ @Override public String toString() { return super.toString() + ", source:" + source(); } }
@Test public void can_test_image_source() { when(evaluator.source(any(Image.class))).thenReturn("http://localhost/myImage.jpg"); Image image = new Image(evaluator, id); assertThat(image.source(), is("http://localhost/myImage.jpg")); }