You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Chris Egerton (Jira)" <ji...@apache.org> on 2022/11/01 16:56:00 UTC

[jira] [Created] (KAFKA-14346) Remove static methods from internal Connect APIs for easier testing

Chris Egerton created KAFKA-14346:
-------------------------------------

             Summary: Remove static methods from internal Connect APIs for easier testing
                 Key: KAFKA-14346
                 URL: https://issues.apache.org/jira/browse/KAFKA-14346
             Project: Kafka
          Issue Type: Improvement
          Components: KafkaConnect
            Reporter: Chris Egerton


Our use of static methods for internal APIs such as the [RestClient class|https://github.com/apache/kafka/blob/9ab140d5419d735baae45aff56ffce7f5622744f/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/rest/RestClient.java] and [Plugins::compareAndSwapLoaders|https://github.com/apache/kafka/blob/9ab140d5419d735baae45aff56ffce7f5622744f/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/Plugins.java#L123-L129] makes testing difficult, especially with the in-progress migration from EasyMock/PowerMock to Mockito.

We should remove these static methods and replace them with non-static methods that can be more easily mocked.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)