(t *testing.T)
| 990 | } |
| 991 | |
| 992 | func TestClusterAdminDescribeConfigWithErrorCode(t *testing.T) { |
| 993 | seedBroker := NewMockBroker(t, 1) |
| 994 | defer seedBroker.Close() |
| 995 | |
| 996 | seedBroker.SetHandlerByMap(map[string]MockResponse{ |
| 997 | "MetadataRequest": NewMockMetadataResponse(t). |
| 998 | SetController(seedBroker.BrokerID()). |
| 999 | SetBroker(seedBroker.Addr(), seedBroker.BrokerID()), |
| 1000 | "DescribeConfigsRequest": NewMockDescribeConfigsResponseWithErrorCode(t), |
| 1001 | }) |
| 1002 | |
| 1003 | config := NewTestConfig() |
| 1004 | config.Version = V1_1_0_0 |
| 1005 | admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config) |
| 1006 | if err != nil { |
| 1007 | t.Fatal(err) |
| 1008 | } |
| 1009 | defer func() { |
| 1010 | _ = admin.Close() |
| 1011 | }() |
| 1012 | |
| 1013 | resource := ConfigResource{ |
| 1014 | Name: "r1", |
| 1015 | Type: TopicResource, |
| 1016 | ConfigNames: []string{"my_topic"}, |
| 1017 | } |
| 1018 | |
| 1019 | _, err = admin.DescribeConfig(resource) |
| 1020 | if err == nil { |
| 1021 | t.Fatal(errors.New("ErrorCode present but no Error returned")) |
| 1022 | } |
| 1023 | } |
| 1024 | |
| 1025 | // TestClusterAdminDescribeBrokerConfig ensures that a describe broker config |
| 1026 | // is sent to the broker in the resource struct, _not_ the controller |
nothing calls this directly
no test coverage detected