String xml = "<some><bpmn2><content/></bpmn2></some>";
BufferedReader reader = new BufferedReader(new StringReader(xml));
EasyMock.expect(request.getReader()).andReturn(reader);
FormDefinitionService formService = EasyMock.createMock(FormDefinitionService.class);
TaskDefinitionService taskService = EasyMock.createMock(TaskDefinitionService.class);
TaskRef task = new TaskRef();
task.setPackageName("somePackage");
EasyMock.expect(taskService.getBPMN2Task(EasyMock.eq(xml), EasyMock.eq("PROCESS_NAME"), EasyMock.eq("USER_TASK"))).andReturn(task).once();
FormRepresentation form = RESTAbstractTest.createMockForm("myForm", "myParam");
EasyMock.expect(formService.getAssociatedForm(EasyMock.eq("somePackage"), EasyMock.eq(task))).andReturn(form).once();
EmbedingServlet servlet = createServlet(formService, taskService);
request.setAttribute(EasyMock.eq("jsonData"), EasyMock.anyObject(String.class));