C0urante opened a new pull request #11983: URL: https://github.com/apache/kafka/pull/11983
[Jira](https://issues.apache.org/jira/browse/KAFKA-13763) Builds on the changes from https://github.com/apache/kafka/pull/11974, which exclusively touched on the `IncrementalCooperativeAssignorTest` test suite. The goals here include: 1. Create an overloaded variant of the `IncrementalCooperativeAssignor::performTaskAssignment` method that is more testing friendly by: 1. Returning the pre-serialization allocation and revocation of connectors and tasks across the cluster in a newly-introduced `ClusterAssignment` class, which eliminates the current pattern of creating a mock `IncrementalCooperativeAssignor` class, spying on one of its private methods, and capturing the argument passed to that spied-upon method 2. Accepting new parameters for the current snapshot of the config topic, the last-completed generation ID, and the current generation ID, which eliminates the need to create and manage a mocked `WorkerCoordinator` instance during testing 3. Not requiring parameters for the leader, config topic offset, or protocol version as these do not affect the logic for allocating connectors and tasks across a cluster 4. Only requires a `Map<String, ConnectorsAndTasks>` for the set of currently-running connectors and tasks across the cluster, instead of a `Map<String, ExtendedWorkerState>`, which contains unnecessary information like the leader, leader URL, protocol version, and config topic offset 2. Simplify the parameter list for the `IncrementalCooperativeAssignor::handleLostAssignments` method, which in turn simplifies the logic for testing this class 3. Capture repeated Java 8 streams logic in simple, reusable, easily-verifiable utility methods added to the `ConnectUtils` class ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org