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);
AbstractMarshallingPayloadEndpoint endpoint = new AbstractMarshallingPayloadEndpoint() {
@Override