Map<String, String> responses1 = new HashMap<String, String>();
responses1.put("GET " + helper.getApiSearchUrl("somePackage") + "form2AutoForm.formdef", jsonForm);
Map<String, String> responses2 = new HashMap<String, String>();
responses2.put("PUT " + helper.getApiSearchUrl("somePackage") + "form2AutoForm.formdef", "OK");
EasyMock.expect(client.executeMethod(EasyMock.isA(MockGetMethod.class))).
andAnswer(new MockAnswer(responses1, new IllegalArgumentException("unexpected call"))).once();
EasyMock.expect(client.executeMethod(EasyMock.isA(MockPutMethod.class))).
andAnswer(new MockAnswer(responses2, new IllegalArgumentException("unexpected call"))).once();
GuvnorFormDefinitionService service = createService(baseUrl, "", "");
service.getHelper().setClient(client);
EasyMock.replay(client);
String formId = service.saveForm("somePackage", form);