@Test
public void testDeserialize() throws Exception {

	JSONObject jsonObject = JSONUtil.put("uri", "http://localhost");
	jsonObject.put(
		"attributes",
		JSONUtil.put(
			AMImageAttribute.AM_IMAGE_ATTRIBUTE_HEIGHT.getName(), "200"
		).put(
			AMImageAttribute.AM_IMAGE_ATTRIBUTE_WIDTH.getName(), "300"
		));
	AMImageSerializer amImageSerializer = new AMImageSerializerImpl();
	InputStream inputStream = Mockito.mock(InputStream.class);
	AdaptiveMedia<AMImageProcessor> adaptiveMedia =
		amImageSerializer.deserialize(
			jsonObject.toString(), () -> inputStream);
	Assert.assertEquals(
		new URI("http://localhost"), adaptiveMedia.getURI());
	Optional<Integer> heightValueOptional = adaptiveMedia.getValueOptional(
		AMImageAttribute.AM_IMAGE_ATTRIBUTE_HEIGHT);
	Assert.assertEquals("200", String.valueOf(heightValueOptional.get()));
	Optional<Integer> widthValueOptional = adaptiveMedia.getValueOptional(
		AMImageAttribute.AM_IMAGE_ATTRIBUTE_WIDTH);
	Assert.assertEquals("300", String.valueOf(widthValueOptional.get()));
}