(t *testing.T)
| 155 | } |
| 156 | |
| 157 | func TestClusterAdminCreateTopicWithInvalidTopicDetail(t *testing.T) { |
| 158 | seedBroker := NewMockBroker(t, 1) |
| 159 | defer seedBroker.Close() |
| 160 | |
| 161 | seedBroker.SetHandlerByMap(map[string]MockResponse{ |
| 162 | "MetadataRequest": NewMockMetadataResponse(t). |
| 163 | SetController(seedBroker.BrokerID()). |
| 164 | SetBroker(seedBroker.Addr(), seedBroker.BrokerID()), |
| 165 | "CreateTopicsRequest": NewMockCreateTopicsResponse(t), |
| 166 | }) |
| 167 | |
| 168 | config := NewTestConfig() |
| 169 | config.Version = V0_10_2_0 |
| 170 | admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config) |
| 171 | if err != nil { |
| 172 | t.Fatal(err) |
| 173 | } |
| 174 | |
| 175 | err = admin.CreateTopic("my_topic", nil, false) |
| 176 | if err.Error() != "you must specify topic details" { |
| 177 | t.Fatal(err) |
| 178 | } |
| 179 | err = admin.Close() |
| 180 | if err != nil { |
| 181 | t.Fatal(err) |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | func TestClusterAdminCreateTopicWithoutAuthorization(t *testing.T) { |
| 186 | seedBroker := NewMockBroker(t, 1) |
nothing calls this directly
no test coverage detected