|
|
@@ -33,6 +33,18 @@ func TestEmptyClientIDConfigValidates(t *testing.T) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+func TestLZ4ConfigValidation(t *testing.T) {
|
|
|
+ config := NewConfig()
|
|
|
+ config.Producer.Compression = CompressionLZ4
|
|
|
+ if err := config.Validate(); string(err.(ConfigurationError)) != "lz4 compression requires Version >= V0_10_0_0" {
|
|
|
+ t.Error("Expected invalid lz4/kakfa version error, got ", err)
|
|
|
+ }
|
|
|
+ config.Version = V0_10_0_0
|
|
|
+ if err := config.Validate(); err != nil {
|
|
|
+ t.Error("Expected lz4 to work, got ", err)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// This example shows how to integrate with an existing registry as well as publishing metrics
|
|
|
// on the standard output
|
|
|
func ExampleConfig_metrics() {
|