public void testInvokeSource() throws Exception {
WebServiceMessage requestMock = createMock(WebServiceMessage.class);
WebServiceMessage responseMock = createMock(WebServiceMessage.class);
expect(requestMock.getPayloadSource()).andReturn(new StringSource(CONTENTS));
expect(responseMock.getPayloadResult()).andReturn(new StringResult());
WebServiceMessageFactory factoryMock = createMock(WebServiceMessageFactory.class);
expect(factoryMock.createWebServiceMessage()).andReturn(responseMock);
replay(requestMock, responseMock, factoryMock);
MessageContext messageContext = new DefaultMessageContext(requestMock, factoryMock);
MethodEndpoint endpoint = new MethodEndpoint(this, "supportedSource", new Class[]{String.class});
adapter.invoke(messageContext, endpoint);