(t *testing.T)
| 91 | } |
| 92 | |
| 93 | func TestClusterAdminCreateTopicWithInvalidTopicDetail(t *testing.T) { |
| 94 | seedBroker := NewMockBroker(t, 1) |
| 95 | defer seedBroker.Close() |
| 96 | |
| 97 | seedBroker.SetHandlerByMap(map[string]MockResponse{ |
| 98 | "MetadataRequest": NewMockMetadataResponse(t). |
| 99 | SetController(seedBroker.BrokerID()). |
| 100 | SetBroker(seedBroker.Addr(), seedBroker.BrokerID()), |
| 101 | "CreateTopicsRequest": NewMockCreateTopicsResponse(t), |
| 102 | }) |
| 103 | |
| 104 | config := NewTestConfig() |
| 105 | config.Version = V0_10_2_0 |
| 106 | admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config) |
| 107 | if err != nil { |
| 108 | t.Fatal(err) |
| 109 | } |
| 110 | |
| 111 | err = admin.CreateTopic("my_topic", nil, false) |
| 112 | if err.Error() != "you must specify topic details" { |
| 113 | t.Fatal(err) |
| 114 | } |
| 115 | err = admin.Close() |
| 116 | if err != nil { |
| 117 | t.Fatal(err) |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | func TestClusterAdminCreateTopicWithoutAuthorization(t *testing.T) { |
| 122 | seedBroker := NewMockBroker(t, 1) |
nothing calls this directly
no test coverage detected