MimeMessage request = createMock("request", MimeMessage.class);
MimeMessage response = createMock("response", MimeMessage.class);
Source requestSource = new StringSource("<request/>");
expect(request.getPayloadSource()).andReturn(requestSource);
expect(factoryMock.createWebServiceMessage()).andReturn(response);
expect(unmarshaller.unmarshal(eq(requestSource), isA(MimeContainer.class))).andReturn(42L);
Result responseResult = new StringResult();
expect(response.getPayloadResult()).andReturn(responseResult);
marshaller.marshal(eq("result"), eq(responseResult), isA(MimeContainer.class));
replay(factoryMock, unmarshaller, marshaller, request, response);