Skip to content
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

CAMEL-17800 add tests in camel-sql-starter #472

Merged

Conversation

JiriOndrusek
Copy link
Contributor

@JiriOndrusek JiriOndrusek commented Mar 17, 2022

Issue: https://issues.apache.org/jira/browse/CAMEL-17800

Here is a list of migrated tests according to the sql component doc:

  • Treatment of the message body in SqlProducerUseMessageBodyForSqlTest
  • Result of the query in SqlProducerUseMessageBodyForSqlTest
  • Using StreamList in SqlProducerOutputTypeStreamListTest
  • Header values in SqlProducerUpdateHeadersTest
  • Generated keys in SqlGeneratedKeysTest
  • DataSource in SqlEndpointMisconfigureDataSourceTest
  • Using named parameters in SqlProducerToDTest
  • Using expression parameters in producers in SqlProducerExpressionParameterTest
  • Using expression parameters in consumers in SqlConsumerDynamicParameterTest
  • Using IN queries with dynamic values in SqlProducerInTest
  • Using the JDBC based idempotent repository in JdbcMessageIdRepositoryTest
  • Customize the JDBC idempotency repository in CustomizedJdbcMessageIdRepositoryTest
  • Orphan Lock aware Jdbc IdempotentRepository in JdbcOrphanLockAwareIdempotentRepositoryTest
  • Caching Jdbc IdempotentRepository in JdbcCachedMessageIdRepositoryTest
  • Using the JDBC based aggregation repository in JdbcAggregateRecoverDeadLetterChannelTest, JdbcAggregateRecoverDeadLetterChannelTest, JdbcAggregateStoreAsTextTest, JdbcAggregateSerializedHeadersTest
  • Transaction in SqlTransactedRouteTest

@orpiske
Copy link
Contributor

orpiske commented Mar 17, 2022

Just out of curiosity - and I apologize because I am not knowledgeable about Spring boot at all - but wouldn't it be easier to maintain these tests by modifying Camel test code to package the tests jar and then extending them here?

@JiriOndrusek
Copy link
Contributor Author

I understand that there is a lot of copy/paste stuff. Unfortunately this is the only approach I see possible for this case. Here are some facts:

  • Tests in camel-sql-starter don't aim to get whole coverage as tests from component itself. Ii's a mere a selection from the tests to cover main "chapters" from the documentation.
  • Even if tests are similar, there is a lot of changes in the code (different approach for configuring routes, different parents, making beans auowirable, ...)
  • from my POV starter tests could be "modified" much more. But I kept the names of classes and test methods for the future for easier determination from with base test it was created. Also to keep consistency with other starters (see for example 8e926a2, f167f45, 7860fca)

@orpiske
Copy link
Contributor

orpiske commented Mar 18, 2022

I understand that there is a lot of copy/paste stuff. Unfortunately this is the only approach I see possible for this case. Here are some facts:

* Tests in camel-sql-starter don't aim to get whole coverage as tests from component itself. Ii's a mere a selection from the tests to cover main "chapters" from the documentation.

* Even if tests are similar, there is a lot of changes in the code (different approach for configuring routes, different parents, making beans auowirable, ...)

* from my POV starter tests could be "modified" much more. But I kept the names of classes and test methods for the future for easier determination from with base test it was created. Also to keep  consistency with other starters (see for example [8e926a2](https://github.com/apache/camel-spring-boot/commit/8e926a2cf299a2ce68be7904089e324366553167), [f167f45](https://github.com/apache/camel-spring-boot/commit/f167f458464a244bab5fcbc465212e3bbbcad0e7), [7860fca](https://github.com/apache/camel-spring-boot/commit/7860fca6ce1213ffd7f01d027e5ea65d3c46346f))

Ahh, I see. Thanks for the heads up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants