-
Notifications
You must be signed in to change notification settings - Fork 5.1k
(test): add test coverage for camel-rest component #21162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🤖 CI automation will test this PR automatically. 🐫 Apache Camel Committers, please review the following items:
|
squakez
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a quick look it seems that these tests are just checking the creation of the mock, asserting that some value is initialized or not null. I don't see any business logic really tested, am I wrong?
indeed, it does seem to be leaning a bit too much on that. I'll mark this one as a draft ... I am still adjusting the spec for coverage and this one need further checks |
Add unit tests for camel-rest component focusing on meaningful behavior tests: - RestComponent URI parsing and endpoint creation - RestEndpoint behavior and error handling - RestProducer query parameter resolution and exchange preparation - RestApiComponent and RestApiEndpoint creation and factory interactions - DefaultRestRegistry service management - RestProducerBindingProcessor and callback behavior Tests cover: - Error conditions and exception handling - URI template placeholder resolution - Query parameter substitution with optional placeholders - Host scheme handling and normalization - Component property propagation - Consumer/producer creation with factories Removed low-quality tests that only verified getters/setters or constants.
50251b8 to
ccef330
Compare
|
camel-rest is tested via other components where you use it with platform-http / jetty / undertow that has rest-dsl tests. |
Yes. We may need to see how to account aggregate report for coverage to have a more meaningful value and don't get tricked by that 0% which is not accurate. I will work on this one. |
Summary
Test Coverage
Tests cover the following classes:
RestComponentandRestEndpointRestApiComponentandRestApiEndpointRestProducerandRestApiProducerDefaultRestRegistryandDefaultRestRegistryFactoryRestProducerBindingProcessorand callbacksTest plan