global: split Akvorado into 3 services

This commit is contained in:
Vincent Bernat
2022-04-01 20:21:53 +02:00
parent a336370c05
commit 1dc253764d
179 changed files with 1768 additions and 1263 deletions

View File

@@ -0,0 +1,36 @@
package kafka
import (
"testing"
"github.com/Shopify/sarama"
)
func TestCompressionCodecUnmarshal(t *testing.T) {
cases := []struct {
Input string
Expected sarama.CompressionCodec
ExpectedError bool
}{
{"none", sarama.CompressionNone, false},
{"zstd", sarama.CompressionZSTD, false},
{"gzip", sarama.CompressionGZIP, false},
{"unknown", sarama.CompressionNone, true},
}
for _, tc := range cases {
var cmp CompressionCodec
err := cmp.UnmarshalText([]byte(tc.Input))
if err != nil && !tc.ExpectedError {
t.Errorf("UnmarshalText(%q) error:\n%+v", tc.Input, err)
continue
}
if err == nil && tc.ExpectedError {
t.Errorf("UnmarshalText(%q) got %v but expected error", tc.Input, cmp)
continue
}
if cmp != CompressionCodec(tc.Expected) {
t.Errorf("UnmarshalText(%q) got %v but expected %v", tc.Input, cmp, tc.Expected)
continue
}
}
}