Discussion:
AW: invoke mock after convertBodyTo
c***@innogy.com
2018-10-17 08:37:24 UTC
Permalink
Hi there,

in the meantime I found the reason for the error: my converter had thrown an exception, and that did not show up.

Kind regards,
Christian Jacob

Von: Jacob, Christian
Gesendet: Mittwoch, 17. Oktober 2018 10:04
An: ***@camel.apache.org
Betreff: invoke mock after convertBodyTo

Hi there,

I have a problem with invoking a mock after using a custom converter. In my test class, I've injected the MockEndpoint this way:
@EndpointInject(uri = "mock:simpleMeasureConverted")
private MockEndpoint mockSimpleMeasureConverted;

and in my route, it is invoked this way:
.convertBodyTo(MyCustomClass.class)
.to("mock:simpleMeasureConverted")

When I configure the mock endpoint to expect one message, this fails, because there are 0 messages arriving at the mock endpoint.

However, if I switched the two lines of my route, the mock endpoint is invoked. But then I can not check the result of the convertBodyTo-invocation. How can the mock be invoked?

Kind regards,
Christian Jacob

Innogy SE
Retail IT
Integration and Digital Solutions (AFS-IGI)
Rellinghauser Str. 37
45128 Essen
T intern: 70-20581
T extern: +49 (0)201 12 20582
T mobil: +49 (0)1622843981
Fax: +49 (0)201 12 24796
mailto: ***@innogy.com

----------------------------------------------------------------
innogy SE
Vorsitzender des Aufsichtsrates: Dr. Erhard Schipporeit
Vorstand: Uwe Tigges (Vorsitzender), Dr. Hans Buenting,
Dr. Bernhard Guenther, Arno Hahn, Martin Herrmann, Hildegard Mueller
Sitz der Gesellschaft: Essen, Eingetragen beim Amtsgericht Essen,
Handelsregister-Nr. HRB 27091, USt-IdNr. DE304171711

Loading...