[
https://issues.apache.org/jira/browse/CAMEL-26133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18136546#comment-18136546
]
Claus Ibsen commented on CAMEL-26133:
-------------------------------------
PR: https://github.com/apache/camel/pull/28907
All three points are fixed. Null body, header, variable and property values are
now not passed to the robot test (a Robot variable cannot be null; the test can
set a default in its own variable table). This also makes the consumer work. A
nested map no longer adds its first entry twice. The doc examples now use
Should Be Equal, with a note not to put the values into an evaluated expression.
_Claude Code on behalf of Claus Ibsen (davsclaus)_
> camel-robotframework - the consumer fails on every poll, and the producer
> fails on a null body or any null header or property
> -----------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-26133
> URL: https://issues.apache.org/jira/browse/CAMEL-26133
> Project: Camel
> Issue Type: Bug
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 4.24.0
>
>
> Found while adding the catalog body types of mapstruct, robotframework,
> citrus and spring-event (CAMEL-24961, PR #28417).
> h4. 1. The consumer can never deliver
> The polled exchange of the consumer has a null body, and
> {{RobotFrameworkCamelUtils.createRobotVariablesFromCamelExchange}} (main
> 2a465aa4814c, line 53) converts the body with
> {{mandatoryConvertTo(String.class, ...)}}, so every poll fails with
> NoTypeConversionAvailableException and the consumer never runs a test.
> Checked on 4.24.0-SNAPSHOT in-process.
> Proposed: skip (or pass as empty) a null body when building the robot
> variables.
> h4. 2. The producer fails on a null body or any null header or property value
> The same {{mandatoryConvertTo}} is used for the body (main 2a465aa4814c, line
> 53) and for every header and exchange property (line 91), so a producer call
> with a null body, or with any header or property whose value is null, fails.
> The doc's examples that use only headers or only properties fail for this
> reason. Checked on 4.24.0-SNAPSHOT in-process.
> Proposed: skip null values (or map them to an empty value) when building the
> robot variables.
> h4. 3. The examples put the body into an expression
> The examples of the page (robotframework-component.adoc, lines 126, 145 and
> 163) use {{Should Be True ${myvar} == ${body}}}, which puts the message
> body (and a header and a property) into an expression that Robot Framework
> evaluates as Python.
> Proposed: compare the values as strings ({{Should Be Equal ${myvar}
> ${body}}}), and add a sentence that the body should not be put into an
> evaluated expression.
> _Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)