camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dharmendra Patel <dharmendra.k.pa...@gmail.com>
Subject Re: how to set null body
Date Fri, 28 Mar 2014 09:17:26 GMT
Hi there,
try replacing simple with constant.

from("")
...
...
.setBody(*constant*(null)).to("http://example.com/id/1)
.process(new MyProcessor()).to("mock:target");


On Fri, Mar 28, 2014 at 2:29 PM, Olaf <omgolafguhl@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.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message