camel-quarkus icon indicating copy to clipboard operation
camel-quarkus copied to clipboard

Foundation:type-converter:tests - refactor the quick fix which is result of CAMEL-20051

Open JiriOndrusek opened this issue 1 year ago • 3 comments

Bug description

Change https://github.com/apache/camel/commit/7c104aaaff93a930cb2b26bb85ae848d9e8d2af3 brought caching of the fallback converters.

Our tests in foundation - ttype-coverter uses fallback converters for several test methods with different converters for the same class in each method. 1 - #1 method caches converter#1 for type A 2 - #2 method converts type A with converter#2, but gets converter#1, which fails the assertion.

Quick fix introduces QuarkusTestProfiles, to force camel context to be restarted is part of camel-main.

Better fix would be the refactor of the methods to use different types for fallback methods, which would avoid the caching issue.

JiriOndrusek avatar Oct 27 '23 14:10 JiriOndrusek

@JiriOndrusek Maybe we should add a method in core to cleanup the cache?

orpiske avatar Oct 27 '23 15:10 orpiske

Hi @orpiske, I was thinking about it, but I can not decide whether we really need it. (clean method would be used only in special cases, probably never during runtime) On the other hand, it can be nice to have it. If it makes sense for you to add such method, we can do that, it would be definitely helpful. But it is not necessary.

JiriOndrusek avatar Oct 30 '23 07:10 JiriOndrusek

Hi @orpiske, I was thinking about it, but I can not decide whether we really need it. (clean method would be used only in special cases, probably never during runtime) On the other hand, it can be nice to have it. If it makes sense for you to add such method, we can do that, it would be definitely helpful. But it is not necessary.

Yeah. That's a risk one to have, as users may try to clean it up and get into trouble because of that. But ... we can try to design it in a way to makes it useful only during testing.

In any case: just let me know what you decide and we can discuss it further if you believe that is the right way.

orpiske avatar Oct 30 '23 09:10 orpiske