kafka icon indicating copy to clipboard operation
kafka copied to clipboard

KAFKA-16084: Simplify and deduplicate standalone herder test mocking

Open ahmedsobeh opened this issue 1 year ago • 0 comments

  • Removed the connector field.
  • The class had a mix of Mock annotations and mock(Class) invocations, cleaned up one of them
  • The test doesn't stop the thread pool created inside the herder and might leak threads, added herder stopping in tearDown
  • Optimized expectConfigValidation
  • Mocking for Worker#startConnector is 6 lines which are duplicated 8 times throughout the test, extracted to a method
  • Some waits are 1000 ms and others are 1000 s, and could be pulled out to constants or a util method. unified and set to a constant

Summary of testing strategy (including rationale) for the feature or bug fix. Unit and/or integration tests are expected for any behaviour change and system tests should be considered for larger changes.

Committer Checklist (excluded from commit message)

  • [ ] Verify design and implementation
  • [ ] Verify test coverage and CI build status
  • [ ] Verify documentation (including upgrade notes)

ahmedsobeh avatar Feb 19 '24 12:02 ahmedsobeh