@Test
public void testSerialize() throws Exception {

	AdaptiveMedia<AMImageProcessor> adaptiveMedia = new AMImage(
		() -> null,
		AMImageAttributeMapping.fromProperties(
			HashMapBuilder.put(
				AMImageAttribute.AM_IMAGE_ATTRIBUTE_HEIGHT.getName(), "200"
			).put(
				AMImageAttribute.AM_IMAGE_ATTRIBUTE_WIDTH.getName(), "300"
			).build()),
		new URI("http://localhost"));
	AMImageSerializer amImageSerializer = new AMImageSerializerImpl();
	String serialize = amImageSerializer.serialize(adaptiveMedia);
	JSONObject jsonObject = JSONFactoryUtil.createJSONObject(serialize);
	Assert.assertEquals("http://localhost", jsonObject.getString("uri"));
	JSONObject attributesJSONObject = jsonObject.getJSONObject(
		"attributes");
	Assert.assertEquals(
		"200",
		attributesJSONObject.getString(
			AMImageAttribute.AM_IMAGE_ATTRIBUTE_HEIGHT.getName()));
	Assert.assertEquals(
		"300",
		attributesJSONObject.getString(
			AMImageAttribute.AM_IMAGE_ATTRIBUTE_WIDTH.getName()));
	AMAttribute<?, Long> contentLengthAMAttribute =
		AMAttribute.getContentLengthAMAttribute();
	Assert.assertEquals(
		StringPool.BLANK,
		attributesJSONObject.getString(contentLengthAMAttribute.getName()));
}