fail(builder.toString());
}
}
public void testRepresentationEncoderImpl() throws Exception {
FormRepresentationEncoderImpl encoder = new FormRepresentationEncoderImpl();
FormRepresentationDecoderImpl decoder = new FormRepresentationDecoderImpl();
FormEncodingFactory.register(encoder, decoder);
assertNull("result should be null", encoder.fromMap(null));
assertNull("result should be null", encoder.fromMap(new HashMap<String, Object>()));
assertNotNull("formattedDate shouldn't be null", encoder.formatDate(new Date()));
FormRepresentation form = RESTAbstractTest.createMockForm("myForm", "myParam1", "myParam2");
FormItemRepresentation item = form.getFormItems().iterator().next();
Map<String, Object> data = item.getDataMap();
Object obj = encoder.fromMap(data);
assertNotNull("obj shouldn't be null", obj);
assertTrue("obj should be of type FormItemRepresentation", obj instanceof FormItemRepresentation);
FormItemRepresentation retval = (FormItemRepresentation) obj;
assertEquals("retval and item should be equal", retval, item);
}