github.com/segmentio/kafka-go@v0.4.48-0.20240318174348-3f6244eb34fd/protocol/listpartitionreassignments/listpartitionreassignments_test.go (about)

     1  package listpartitionreassignments_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/segmentio/kafka-go/protocol/listpartitionreassignments"
     7  	"github.com/segmentio/kafka-go/protocol/prototest"
     8  )
     9  
    10  const (
    11  	v0 = 0
    12  )
    13  
    14  func TestListPartitionReassignmentsRequest(t *testing.T) {
    15  	prototest.TestRequest(t, v0, &listpartitionreassignments.Request{
    16  		Topics: []listpartitionreassignments.RequestTopic{
    17  			{
    18  				Name:             "topic-1",
    19  				PartitionIndexes: []int32{1, 2, 3},
    20  			},
    21  		},
    22  	})
    23  }
    24  
    25  func TestListPartitionReassignmentsResponse(t *testing.T) {
    26  	prototest.TestResponse(t, v0, &listpartitionreassignments.Response{
    27  		Topics: []listpartitionreassignments.ResponseTopic{
    28  			{
    29  				Name: "topic-1",
    30  				Partitions: []listpartitionreassignments.ResponsePartition{
    31  					{
    32  						PartitionIndex:   1,
    33  						Replicas:         []int32{1, 2, 3},
    34  						AddingReplicas:   []int32{4, 5, 6},
    35  						RemovingReplicas: []int32{7, 8, 9},
    36  					},
    37  				},
    38  			},
    39  		},
    40  	})
    41  }