assertAttributeMissing("birthdate", json);
}
@Test
public void testHtmlTransformation() {
String json = new JSONSerializer().transform(new HtmlEncoderTransformer(), "").serialize("Marker & Thompson");
assertEquals("Assert that the & was replaced with &", "\"Marker & Thompson\"", json);
Map<String, String> map = new HashMap<String, String>();
map.put("Chuck D", "Chuck D <chuckd@publicenemy.com>");
map.put("Run", "Run <run@rundmc.com>");
json = new JSONSerializer().transform(new HtmlEncoderTransformer(), String.class).serialize(map);
assertStringValue("Chuck D <chuckd@publicenemy.com>", json);
assertStringValue("Run <run@rundmc.com>", json);
Person xeno = new Person("><eno", "h&d", new Date(), new Address("1092 Hemphill", "Atlanta", "GA", new Zipcode("30319")), new Address("333 \"Diddle & Town\"", "Atlanta", "30329", new Zipcode("30320")));
json = new JSONSerializer().transform(new HtmlEncoderTransformer(), "firstname", "lastname").exclude("*.class").serialize(xeno);
assertStringValue("><eno", json);
assertStringValue("h&d", json);
assertStringValue("333 \\u0022Diddle \\u0026 Town\\u0022", json);
assertStringValueMissing("333 "Diddle & Town"", json);