MuleClient client = new MuleClient(muleContext);
RemoteDispatcher dispatcher = client.getRemoteDispatcher(getRemoteEndpointUri());
// Doubling timeout see MULE-3000
// Use TIMEOUT_NOT_SET_VALUE as we need respective remoteDispatcherEndpoint to you timeout as defined on the endpoint.
MuleMessage message = dispatcher.receiveRemote(remoteEndpoint,MuleEvent.TIMEOUT_NOT_SET_VALUE);
assertNull(message);
// We do a send instead of a dispatch here so the operation is
// synchronous thus eaiser to test
dispatcher.sendRemote(remoteEndpoint, "Test Remote Message 2", null);