[mule-scm] [mule][25293] branches/mule-3.x: MULE-6668 - HTTP MessageContext is returning the MessageReceiver, not the InboundEndpoint

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[mule-scm] [mule][25293] branches/mule-3.x: MULE-6668 - HTTP MessageContext is returning the MessageReceiver, not the InboundEndpoint

pablo.lagreca
[mule][25293] branches/mule-3.x: MULE-6668 - HTTP MessageContext is returning the MessageReceiver, not the InboundEndpoint
Revision
25293
Author
pablo.lagreca
Date
2013-02-19 13:10:09 -0600 (Tue, 19 Feb 2013)

Log Message

MULE-6668 - HTTP MessageContext is returning the MessageReceiver, not the InboundEndpoint

Modified Paths

Diff

Modified: branches/mule-3.x/core/src/main/java/org/mule/transport/AbstractTransportMessageProcessTemplate.java (25292 => 25293)


--- branches/mule-3.x/core/src/main/java/org/mule/transport/AbstractTransportMessageProcessTemplate.java	2013-02-19 18:25:17 UTC (rev 25292)
+++ branches/mule-3.x/core/src/main/java/org/mule/transport/AbstractTransportMessageProcessTemplate.java	2013-02-19 19:10:09 UTC (rev 25293)
@@ -56,10 +56,9 @@
     @Override
     public MessageSource getMessageSource()
     {
-        return this.messageReceiver;
+        return this.messageReceiver.getEndpoint();
     }
 
-
     @Override
     public Object getOriginalMessage() throws MuleException
     {

Modified: branches/mule-3.x/transports/http/src/test/java/org/mule/transport/http/HttpMessageReceiverTestCase.java (25292 => 25293)


--- branches/mule-3.x/transports/http/src/test/java/org/mule/transport/http/HttpMessageReceiverTestCase.java	2013-02-19 18:25:17 UTC (rev 25292)
+++ branches/mule-3.x/transports/http/src/test/java/org/mule/transport/http/HttpMessageReceiverTestCase.java	2013-02-19 19:10:09 UTC (rev 25293)
@@ -10,7 +10,9 @@
 
 package org.mule.transport.http;
 
+import static org.hamcrest.core.Is.is;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertThat;
 import static org.mockito.Mockito.mock;
 
 import org.mule.api.endpoint.EndpointBuilder;
@@ -19,12 +21,15 @@
 import org.mule.api.transport.Connector;
 import org.mule.api.transport.MessageReceiver;
 import org.mule.endpoint.EndpointURIEndpointBuilder;
+import org.mule.message.processing.MessageProcessContext;
 import org.mule.transport.AbstractMessageReceiverTestCase;
 import org.mule.transport.http.transformers.MuleMessageToHttpResponse;
 import org.mule.util.CollectionUtils;
 
+import org.hamcrest.core.Is;
 import org.junit.Before;
 import org.junit.Test;
+import org.mockito.Mockito;
 
 public class HttpMessageReceiverTestCase extends AbstractMessageReceiverTestCase
 {
@@ -75,4 +80,12 @@
     {
         assertEquals("client/name", httpMessageReceiver.processRelativePath(CONTEXT_PATH, CLIENT_NAME_PATH));
     }
+
+    @Test
+    public void messageSourceIsEndpointNotMessageReceiver()
+    {
+        HttpServerConnection mockHttpServerConnection = Mockito.mock(HttpServerConnection.class);
+        MessageProcessContext messageContext = httpMessageReceiver.createMessageContext(mockHttpServerConnection);
+        assertThat((InboundEndpoint) messageContext.getMessageSource(), is(httpMessageReceiver.getEndpoint()));
+    }
 }

To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Loading...