You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Noa Resare (Jira)" <ji...@apache.org> on 2020/09/16 18:14:00 UTC

[jira] [Created] (KAFKA-10490) Make constructors public for Admin API value objects

Noa Resare created KAFKA-10490:
----------------------------------

             Summary: Make constructors public for Admin API value objects
                 Key: KAFKA-10490
                 URL: https://issues.apache.org/jira/browse/KAFKA-10490
             Project: Kafka
          Issue Type: Improvement
          Components: clients
    Affects Versions: 2.6.0
            Reporter: Noa Resare


Developers writing automation that uses the {{Admin}} API will in many cases want to create a mock and configure that mock to return the value objects that is expected to be able to test other pieces of functionality in a controlled way.

However, since the constructors in the value objects that the various API endpoints return are either {{protected}} or the default access level, instantiating such value objects takes needs to use some convoluted trick to create instances (either mock them with a mocking framework, use reflection magic or create a helper method in the same package as they appear).

Please consider updating the constructor signatures and make them public and in doing so encourage good testing practices everywhere.

Here are some examples of classes affected by this:
 * CreateTopicsResult
 * DeleteTopicsResult
 * ListTopicsResult
 * DescribeTopicsResult
 * DescribeClusterResult
 * DescribeAclsResult
 * CreateAclsResul
 * DeleteAclsResult
 * DescribeConfigsResult
 * AlterConfigsResult
 * AlterReplicaLogDirsResult
 * DescribeLogDirsResult
 * DescribeReplicaLogDirsResult
 * CreatePartitionsResult
 * CreateDelegationTokenResult
 * RenewDelegationTokenResult
 * ExpireDelegationTokenResult
 * DescribeDelegationTokenResult
 * ...and so on



--
This message was sent by Atlassian Jira
(v8.3.4#803005)