spring-pulsar icon indicating copy to clipboard operation
spring-pulsar copied to clipboard

Enhance tests for newly added transaction support

Open onobc opened this issue 1 year ago • 0 comments

          Here are the subsequent items that need to be completed cc: @jonas-grgt : 
  • [ ] The PulsarListenerTxnTests already have tests for a @PulsarListener wrapped 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 PulsarTemplateLocalTransactionTests already 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 the consume-apply-publish use case. However, I think it would be a good idea to add a PulsarTemplateTransactionTests that create a service w/ methods marked @Transactional and verify that usage of a PulsarTemplate in those business method enlists in that outer transaction.

  • [x] Tests for the newly introduced transaction.* package

  • [x] The MethodPulsarListenerEndpoint#validateAndAdjustTransactionSettings needs tests (here)

  • [x] TransactionProperties + TransactionSettings need basic sanity unit tests specifically determineTransactionDefinition()

  • [x] DefaultPulsarMessageListenerContainer#validateTransactionSettings needs check for "custom errorHandler w/ transactions not supported" (here)

  • [x] Assert that AckUtils are being called as expected in DefaultPulsarMessageListenerContainerTxnTests at batchListenerUsesBatchAckWhenSharedSub and batchListenerUsesCumulativeAckWhenNotSharedSub

Originally posted by @onobc in https://github.com/spring-projects/spring-pulsar/issues/27#issuecomment-2038889689

onobc avatar Apr 15 '24 23:04 onobc