Class AdminClientTestUtils

java.lang.Object
org.apache.kafka.clients.admin.AdminClientTestUtils

public class AdminClientTestUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.kafka.clients.admin.AlterConfigsResult
    alterConfigsResult(org.apache.kafka.common.config.ConfigResource cr)
    Helper to create a AlterConfigsResult instance for a given ConfigResource.
    static org.apache.kafka.clients.admin.AlterConfigsResult
    alterConfigsResult(org.apache.kafka.common.config.ConfigResource cr, Throwable t)
    Helper to create a AlterConfigsResult instance for a given Throwable.
    static org.apache.kafka.clients.admin.BrokerHealthStatusResult
    brokerHealthStatusResult(Integer brokerId, org.apache.kafka.clients.admin.BrokerComponent brokerComponent, org.apache.kafka.clients.admin.ComponentHealthStatus componentHealthStatus)
    Used for BrokerHealthCommand tests as the constructor is only accessible from within the admin package
    static org.apache.kafka.clients.admin.Admin
    create(Map<String,Object> conf, org.apache.kafka.clients.HostResolver hostResolver)
    Helper to create a KafkaAdminClient with a custom HostResolver accessible to tests outside this package.
    static org.apache.kafka.clients.admin.ListOffsetsResult
    createListOffsetsResult(Map<org.apache.kafka.common.TopicPartition, org.apache.kafka.clients.consumer.OffsetAndMetadata> partitionOffsets)
     
    static org.apache.kafka.clients.admin.ListShareGroupOffsetsResult
    createListShareGroupOffsetsResult(Map<String, org.apache.kafka.common.KafkaFuture<Map<org.apache.kafka.common.TopicPartition, org.apache.kafka.clients.admin.SharePartitionOffsetInfo>>> groupOffsets)
     
    static org.apache.kafka.clients.admin.CreatePartitionsResult
    Helper to create a CreatePartitionsResult instance for a given Throwable.
    static org.apache.kafka.clients.admin.CreateTopicsResult
    Helper to create a CreateTopicsResult instance for a given Throwable.
    static org.apache.kafka.clients.admin.DeleteTopicsResult
    Helper to create a DeleteTopicsResult instance for a given Throwable.
    static org.apache.kafka.clients.admin.DescribeConfigsResult
    describeConfigsResult(org.apache.kafka.common.config.ConfigResource cr, org.apache.kafka.clients.admin.Config config)
    Helper to create a DescribeConfigsResult instance for a given ConfigResource.
    static org.apache.kafka.clients.admin.DescribeTopicsResult
    describeTopicsResult(String topic, org.apache.kafka.clients.admin.TopicDescription description)
    Helper to create a DescribeTopicsResult instance for a given topic.
    static org.apache.kafka.clients.admin.DescribeTopicsResult
    describeTopicsResult(Map<String, org.apache.kafka.clients.admin.TopicDescription> topicDescriptions)
     
    static org.apache.kafka.clients.admin.DescribeTopicsResult
     
    static org.apache.kafka.clients.admin.ListConfigResourcesResult
     
    static org.apache.kafka.clients.admin.ListConfigResourcesResult
    listConfigResourcesResult(Map<org.apache.kafka.common.config.ConfigResource.Type, Set<String>> resourceNames)
     
    static org.apache.kafka.clients.admin.ListConfigResourcesResult
    listConfigResourcesResult(org.apache.kafka.common.KafkaException exception)
     
    static org.apache.kafka.clients.admin.ListConsumerGroupOffsetsResult
    listConsumerGroupOffsetsResult(String group, org.apache.kafka.common.KafkaException exception)
     
    static org.apache.kafka.clients.admin.ListConsumerGroupOffsetsResult
    listConsumerGroupOffsetsResult(Map<String, Map<org.apache.kafka.common.TopicPartition, org.apache.kafka.clients.consumer.OffsetAndMetadata>> offsets)
     
    static org.apache.kafka.clients.admin.ListGroupsResult
    listGroupsResult(org.apache.kafka.clients.admin.GroupListing... groups)
     
    static org.apache.kafka.clients.admin.ListGroupsResult
    listGroupsResult(org.apache.kafka.common.KafkaException exception)
     
    static org.apache.kafka.clients.admin.ListPartitionReassignmentsResult
    Helper to create a ListPartitionReassignmentsResult instance for a given Throwable.
    static org.apache.kafka.clients.admin.ListTopicsResult
    Helper to create a ListTopicsResult instance for a given topic.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AdminClientTestUtils

      public AdminClientTestUtils()
  • Method Details

    • listPartitionReassignmentsResult

      public static org.apache.kafka.clients.admin.ListPartitionReassignmentsResult listPartitionReassignmentsResult(Throwable t)
      Helper to create a ListPartitionReassignmentsResult instance for a given Throwable. ListPartitionReassignmentsResult's constructor is only accessible from within the admin package.
    • createTopicsResult

      public static org.apache.kafka.clients.admin.CreateTopicsResult createTopicsResult(String topic, Throwable t)
      Helper to create a CreateTopicsResult instance for a given Throwable. CreateTopicsResult's constructor is only accessible from within the admin package.
    • deleteTopicsResult

      public static org.apache.kafka.clients.admin.DeleteTopicsResult deleteTopicsResult(String topic, Throwable t)
      Helper to create a DeleteTopicsResult instance for a given Throwable. DeleteTopicsResult's constructor is only accessible from within the admin package.
    • listTopicsResult

      public static org.apache.kafka.clients.admin.ListTopicsResult listTopicsResult(String topic)
      Helper to create a ListTopicsResult instance for a given topic. ListTopicsResult's constructor is only accessible from within the admin package.
    • alterConfigsResult

      public static org.apache.kafka.clients.admin.AlterConfigsResult alterConfigsResult(org.apache.kafka.common.config.ConfigResource cr, Throwable t)
      Helper to create a AlterConfigsResult instance for a given Throwable. AlterConfigsResult's constructor is only accessible from within the admin package.
    • alterConfigsResult

      public static org.apache.kafka.clients.admin.AlterConfigsResult alterConfigsResult(org.apache.kafka.common.config.ConfigResource cr)
      Helper to create a AlterConfigsResult instance for a given ConfigResource. AlterConfigsResult's constructor is only accessible from within the admin package.
    • describeConfigsResult

      public static org.apache.kafka.clients.admin.DescribeConfigsResult describeConfigsResult(org.apache.kafka.common.config.ConfigResource cr, org.apache.kafka.clients.admin.Config config)
      Helper to create a DescribeConfigsResult instance for a given ConfigResource. DescribeConfigsResult's constructor is only accessible from within the admin package.
    • createPartitionsResult

      public static org.apache.kafka.clients.admin.CreatePartitionsResult createPartitionsResult(String topic, Throwable t)
      Helper to create a CreatePartitionsResult instance for a given Throwable. CreatePartitionsResult's constructor is only accessible from within the admin package.
    • describeTopicsResult

      public static org.apache.kafka.clients.admin.DescribeTopicsResult describeTopicsResult(String topic, org.apache.kafka.clients.admin.TopicDescription description)
      Helper to create a DescribeTopicsResult instance for a given topic. DescribeTopicsResult's constructor is only accessible from within the admin package.
    • describeTopicsResult

      public static org.apache.kafka.clients.admin.DescribeTopicsResult describeTopicsResult(Map<String, org.apache.kafka.clients.admin.TopicDescription> topicDescriptions)
    • describeTopicsResultWithException

      public static org.apache.kafka.clients.admin.DescribeTopicsResult describeTopicsResultWithException(String topic, Throwable e)
    • listGroupsResult

      public static org.apache.kafka.clients.admin.ListGroupsResult listGroupsResult(org.apache.kafka.clients.admin.GroupListing... groups)
    • listGroupsResult

      public static org.apache.kafka.clients.admin.ListGroupsResult listGroupsResult(org.apache.kafka.common.KafkaException exception)
    • listConsumerGroupOffsetsResult

      public static org.apache.kafka.clients.admin.ListConsumerGroupOffsetsResult listConsumerGroupOffsetsResult(Map<String, Map<org.apache.kafka.common.TopicPartition, org.apache.kafka.clients.consumer.OffsetAndMetadata>> offsets)
    • listConsumerGroupOffsetsResult

      public static org.apache.kafka.clients.admin.ListConsumerGroupOffsetsResult listConsumerGroupOffsetsResult(String group, org.apache.kafka.common.KafkaException exception)
    • listConfigResourcesResult

      public static org.apache.kafka.clients.admin.ListConfigResourcesResult listConfigResourcesResult(Map<org.apache.kafka.common.config.ConfigResource.Type, Set<String>> resourceNames)
    • listConfigResourcesResult

      public static org.apache.kafka.clients.admin.ListConfigResourcesResult listConfigResourcesResult(String... names)
    • listConfigResourcesResult

      public static org.apache.kafka.clients.admin.ListConfigResourcesResult listConfigResourcesResult(org.apache.kafka.common.KafkaException exception)
    • createListShareGroupOffsetsResult

      public static org.apache.kafka.clients.admin.ListShareGroupOffsetsResult createListShareGroupOffsetsResult(Map<String, org.apache.kafka.common.KafkaFuture<Map<org.apache.kafka.common.TopicPartition, org.apache.kafka.clients.admin.SharePartitionOffsetInfo>>> groupOffsets)
    • createListOffsetsResult

      public static org.apache.kafka.clients.admin.ListOffsetsResult createListOffsetsResult(Map<org.apache.kafka.common.TopicPartition, org.apache.kafka.clients.consumer.OffsetAndMetadata> partitionOffsets)
    • brokerHealthStatusResult

      public static org.apache.kafka.clients.admin.BrokerHealthStatusResult brokerHealthStatusResult(Integer brokerId, org.apache.kafka.clients.admin.BrokerComponent brokerComponent, org.apache.kafka.clients.admin.ComponentHealthStatus componentHealthStatus)
      Used for BrokerHealthCommand tests as the constructor is only accessible from within the admin package
    • create

      public static org.apache.kafka.clients.admin.Admin create(Map<String,Object> conf, org.apache.kafka.clients.HostResolver hostResolver)
      Helper to create a KafkaAdminClient with a custom HostResolver accessible to tests outside this package.