Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-16084

Simplify and deduplicate StandaloneHerderTest mocking

    XMLWordPrintableJSON

Details

    • Test
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.8.0
    • connect

    Description

      The StandaloneHerderTest has some cruft that can be cleaned up. What i've found:

      • The `connector` field is written in nearly every test, but only read by one test, and looks to be nearly irrelevant.
      • `expectConfigValidation` has two ways of specifying consecutive validations. 1. The boolean shouldCreateConnector which is true in the first invocation and false in subsequent invocations. 2. by passing multiple configurations via varargs.
      • The class uses a mix of Mock annotations and mock(Class) invocations
      • The test doesn't stop the thread pool created inside the herder and might leak threads
      • Mocking for Worker#startConnector is 6 lines which are duplicated 8 times throughout the test
      • Some waits are 1000 ms and others are 1000 s, and could be pulled out to constants or a util method

      Attachments

        Issue Links

          Activity

            People

              ahmedsobeh Ahmed Sobeh
              gharris1727 Greg Harris
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: