final ServletContext context = EasyMock.createMock(ServletContext.class);
final HttpServletRequest request = EasyMock.createMock(HttpServletRequest.class);
RESTFormService restService = emulateRESTFormService(null, new TranslatorException("Not finding translator"), null, null);
restService.setFormService(new MockFormDefinitionService());
FormPreviewDTO dto = new FormPreviewDTO();
FormRepresentation form = createMockForm("myForm", "key1", "key2");
String jsonBody = FormEncodingFactory.getEncoder().encode(form);
dto.setRepresentation(jsonBody);
EasyMock.replay(context, request);
Response resp = restService.getFormPreview(dto, "lang", context, request);
EasyMock.verify(context, request);