@Test
public void testJSONSerialization() throws Exception {

	IdentityContextMessage.Builder identityContextMessageBuilder =
		IdentityContextMessage.builder("DataSourceId");
	identityContextMessageBuilder.domain("liferay.com");
	identityContextMessageBuilder.language("en-US");
	identityContextMessageBuilder.platform("MacIntel");
	identityContextMessageBuilder.protocolVersion("1.0");
	identityContextMessageBuilder.timezone("CET");
	identityContextMessageBuilder.identityFieldsProperty(
		"email", "julio.camarero@liferay.com");
	identityContextMessageBuilder.identityFieldsProperty(
		"name", "Julio Camarero");
	String actualJSON = _jsonObjectMapper.map(
		identityContextMessageBuilder.build());
	String expectedJSON = read("identity_context_message.json");
	JSONAssert.assertEquals(expectedJSON, actualJSON, false);
}