ImageAction { public abstract String getImageSource();  abstract String getImageSource(); static boolean doesStringRepresentImageAction(String assumedRepresentation); String toStringRepresentation(); static ImageAction fromStringRepresentation(String representation); @Override boolean equals(Object o);  }
@Test public void testExternalGifImageAction() { String gifSource = "https: ExternalGifImageAction action = (ExternalGifImageAction) getSerializedDeserialized(new ExternalGifImageAction(gifSource)); assertThat(action.getImageSource(), is(gifSource)); }
@Test public void testEmbeddedImageAction() { int imageId = 110; String imageSource = "https: EmbeddedImageAction action = (EmbeddedImageAction) getSerializedDeserialized(new EmbeddedImageAction(imageId, imageSource)); assertThat(action.getImageId(), is(imageId)); assertThat(action.getImageSource(), is(imageSource)); }
@Test public void testEmbeddedFilteredImageAction() { int imageId = 110; String imageSource = "https: String filterSource = "https: String tagName = "trixie is best pony"; EmbeddedFilteredImageAction action = (EmbeddedFilteredImageAction) getSerializedDeserialized(new EmbeddedFilteredImageAction(imageId, imageSource, filterSource, tagName)); assertThat(action.getImageId(), is(imageId)); assertThat(action.getImageSource(), is(filterSource)); action.unspoiler(); assertThat(action.getImageSource(), is(imageSource)); assertThat(action.getFilteredTagName(), is(tagName)); }