You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Otavio Rodolfo Piske (Jira)" <ji...@apache.org> on 2020/08/26 09:02:00 UTC

[jira] [Comment Edited] (CAMEL-15453) camel-jdbc: replacing deprecated code leads to test failures

    [ https://issues.apache.org/jira/browse/CAMEL-15453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17185015#comment-17185015 ] 

Otavio Rodolfo Piske edited comment on CAMEL-15453 at 8/26/20, 9:01 AM:
------------------------------------------------------------------------

-The problem may be caused because of this: [https://github.com/apache/camel/blob/4ea9e6c357371682b855d2d79655b41120331b7a/core/camel-support/src/main/java/org/apache/camel/support/DefaultExchange.java#L393]-

 -- 

-If an out message is not available, the in one is returned. So, to retain previous behavior, we can just test if the getMessage "equals" to the sent one and infer that the out one was null.-

 -- 

-I'll adjust this when I send the PR.-

 -- 

[~cibsen@e-ma.net]  -IMHO, this ticket is not really applicable and could be closed.-


The statement above is not correct.

 


was (Author: orpiske):
The problem may be caused because of this: [https://github.com/apache/camel/blob/4ea9e6c357371682b855d2d79655b41120331b7a/core/camel-support/src/main/java/org/apache/camel/support/DefaultExchange.java#L393]

 

If an out message is not available, the in one is returned. So, to retain previous behavior, we can just test if the getMessage "equals" to the sent one and infer that the out one was null.

 

I'll adjust this when I send the PR.

 

[~cibsen@e-ma.net]  IMHO, this ticket is not really applicable and could be closed.

> camel-jdbc: replacing deprecated code leads to test failures
> ------------------------------------------------------------
>
>                 Key: CAMEL-15453
>                 URL: https://issues.apache.org/jira/browse/CAMEL-15453
>             Project: Camel
>          Issue Type: Task
>          Components: camel-jdbc
>    Affects Versions: 3.5.0
>            Reporter: Otavio Rodolfo Piske
>            Priority: Major
>         Attachments: deprecations-trace.txt, jdbc-deprecations.patch
>
>
> In camel-jdbc modifying the code to replace calls to getOut with getMessage, as instructed by the javadoc, leads to a test failure in {{JdbcOptionsTest.testInsertCommit}}.
>  
> The code fails because [this assertion fails|https://github.com/apache/camel/blob/4ea9e6c357371682b855d2d79655b41120331b7a/components/camel-jdbc/src/test/java/org/apache/camel/component/jdbc/JdbcOptionsTest.java#L64]. In other words, the call to {{mock.getExchanges().get(0).getIn().getBody(String.class);}}  does return a body when applying these changes.
>  
> I am attaching a patch that can be used to reproduce the issue. To apply the patch, from the camel-jdbc component directory, use {{patch -p3 < jdbc-deprecations.patch}}.
>  
> *Note 1*: Removing the assertion doesn't seem to affect the results of the test
> *Note 2*: JdbcOptionsTest is not even modified by the patch.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)