Camel 3: error with Mockito

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Camel 3: error with Mockito

Andriy Klymenko

Hi,

 

We use Camel 2 in our project for more than 3 years.

Recently we decided to migrate to Camel 3 but faced a problem in unit tests.

 

Our unit tests don't work as before: Mockito invokes a real method instead of mocked one.

Moreover, it depends on environment- everything works as expected on Windows 10 Pro(v1809), but fails on Linux (Ubuntu 18.04.3 LTS, CentOS Linux 7).

In both of cases we use Java 8 (build 1.8.0_201-b09) and Maven 3.6.3.

 

I prepared a simple project that can help to reproduce this error. You can find it in the attachment.

Could you take a look at this example and help me to solve this problem?

 

Best regards,

Andriy Klymenko

E-mail: [hidden email]

 


camel-migration-error-example.zip (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Camel 3: error with Mockito

John Poth
Hi Andriy, can you try specifying the method you want to call in you route
i.e

.bean(positionMapItem, "map") ? Thanks !

On Tue, May 19, 2020 at 8:00 PM Andriy Klymenko
<[hidden email]> wrote:

> Hi,
>
>
>
> We use Camel 2 in our project for more than 3 years.
>
> Recently we decided to migrate to *Camel 3* but faced a problem in unit
> tests.
>
>
>
> Our unit tests don't work as before: *Mockito invokes a real method*
> instead of mocked one.
>
> Moreover, it depends on environment- everything works as expected on
> Windows 10 Pro(v1809), but *fails on Linux* (Ubuntu 18.04.3 LTS, CentOS
> Linux 7).
>
> In both of cases we use Java 8 (build 1.8.0_201-b09) and Maven 3.6.3.
>
>
>
> I prepared a simple project that can help to reproduce this error. You can
> find it in the attachment.
>
> Could you take a look at this example and help me to solve this problem?
>
>
>
> Best regards,
>
> Andriy Klymenko
>
> E-mail: [hidden email]
>
>
>