You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on Quarkus REST Client, I implemented an API adapter for a complex API including caching, retry strategy, paging, etc. Now, I want to re-use this API adapter in another Quarkus microservice, which also needs to talk to this API. Therefore, I thought about moving the API adapter into a custom Quarkus extension.
I have full test coverage for the API adapter by spinning up Wiremock to simulate the external API with different scenarios. Of course I would like to move testing also to the extension project so that I can develop the API adapter in a test-driven way.
I struggle to understand how to do testing of extension code. My extension does nothing as long as nobody is injecting my exposed bean. So it seems the usual deployment-module QuarkusUnitTest approach is not what I'm looking for.
There, they also have no single "unit" test. Instead, they rely on integration tests where they write a small application using this extension. Is this the right approach or am I missing something?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Based on Quarkus REST Client, I implemented an API adapter for a complex API including caching, retry strategy, paging, etc. Now, I want to re-use this API adapter in another Quarkus microservice, which also needs to talk to this API. Therefore, I thought about moving the API adapter into a custom Quarkus extension.
I have full test coverage for the API adapter by spinning up Wiremock to simulate the external API with different scenarios. Of course I would like to move testing also to the extension project so that I can develop the API adapter in a test-driven way.
I struggle to understand how to do testing of extension code. My extension does nothing as long as nobody is injecting my exposed bean. So it seems the usual deployment-module QuarkusUnitTest approach is not what I'm looking for.
I looked for examples and found https://github.com/quarkiverse/quarkus-google-cloud-services/tree/main/firestore
There, they also have no single "unit" test. Instead, they rely on integration tests where they write a small application using this extension. Is this the right approach or am I missing something?
Beta Was this translation helpful? Give feedback.
All reactions