You need to use Camel 2.12.3 or better to use the null function with simple

simple("${null}")
http://camel.apache.org/simple

And yeah the constant(null) may also do the trick. Not sure if we do a
!= null check in camel-core, but give it a try

On Fri, Mar 28, 2014 at 9:59 AM, Olaf <omgolafg...@gmail.com> wrote:
> Hello,
>
> at some point in my route I need to make a GET request. According to the
> documentation the body must be null for GET. Asserting null body however
> does not work.
>
> from("")
> ...
> ...
> .setBody(simple(null)).to("http://example.com/id/1)
> .process(new MyProcessor()).to("mock:target");
>
> TEST:
>
> httpEndpoint.message(0).body().isEqualTo(null);
> java.lang.AssertionError: Assertion error at index 0 on mock mock://httpjson
> with predicate: body == null evaluated as: Simple: null == null on
> Exchange[Message: Simple: null]
>
>
> Thanks!
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/how-to-set-null-body-tp5749484.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Reply via email to