update kafka test with latst metadata
@@ -17,22 +17,22 @@ type parseKafkaMetadataTestData struct {
// A complete valid metadata example for reference
var validMetadata = map[string]string{
"brokerList": "broker1:9092,broker2:9092",
- "groupName": "my-group",
- "topicName": "my-topic",
+ "consumerGroup": "my-group",
+ "topic": "my-topic",
}
var parseKafkaMetadataTestDataset = []parseKafkaMetadataTestData{
{map[string]string{}, true, 0, nil, "", ""},
{map[string]string{"brokerList": "foobar:9092"}, true, 1, []string{"foobar:9092"}, "", ""},
{map[string]string{"brokerList": "foo:9092,bar:9092"}, true, 2, []string{"foo:9092", "bar:9092"}, "", ""},
- {map[string]string{"brokerList": "a", "groupName": "my-group"}, true, 1, []string{"a"}, "my-group", ""},
+ {map[string]string{"brokerList": "a", "consumerGroup": "my-group"}, true, 1, []string{"a"}, "my-group", ""},
{validMetadata, false, 2, []string{"broker1:9092", "broker2:9092"}, "my-group", "my-topic"},
}
func TestGetBrokers(t *testing.T) {
for _, testData := range parseKafkaMetadataTestDataset {
-
meta, err := parseKafkaMetadata(testData.metadata)
+
if err != nil && !testData.isError {
t.Error("Expected success but got error", err)
}
