Enhance tests for newly added transaction support
Here are the subsequent items that need to be completed cc: @jonas-grgt :
-
[ ] The
PulsarListenerTxnTestsalready have tests for a@PulsarListenerwrapped w/@Transactional. It would be a good idea to extend/add to these tests by having some transactional JPA access in the listener method and making sure rollbacks do what we expect. -
[ ] The
PulsarTemplateLocalTransactionTestsalready tests local transactions and the other txn tests for the container all use the template in the listen method to make sure all rollback/commit work as expected for theconsume-apply-publishuse case. However, I think it would be a good idea to add aPulsarTemplateTransactionTeststhat create a service w/ methods marked@Transactionaland verify that usage of aPulsarTemplatein those business method enlists in that outer transaction. -
[x] Tests for the newly introduced
transaction.*package -
[x] The
MethodPulsarListenerEndpoint#validateAndAdjustTransactionSettingsneeds tests (here) -
[x]
TransactionProperties+TransactionSettingsneed basic sanity unit tests specificallydetermineTransactionDefinition() -
[x]
DefaultPulsarMessageListenerContainer#validateTransactionSettingsneeds check for "custom errorHandler w/ transactions not supported" (here) -
[x] Assert that
AckUtilsare being called as expected inDefaultPulsarMessageListenerContainerTxnTestsatbatchListenerUsesBatchAckWhenSharedSubandbatchListenerUsesCumulativeAckWhenNotSharedSub
Originally posted by @onobc in https://github.com/spring-projects/spring-pulsar/issues/27#issuecomment-2038889689