camel-quarkus
camel-quarkus copied to clipboard
Foundation:type-converter:tests - refactor the quick fix which is result of CAMEL-20051
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 Maybe we should add a method in core to cleanup the cache?
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.
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.