MCPcopy
hub / github.com/IBM/sarama / TestLZ4ConfigValidation

Function TestLZ4ConfigValidation

config_test.go:505–517  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

503}
504
505func TestLZ4ConfigValidation(t *testing.T) {
506 config := NewTestConfig()
507 config.Producer.Compression = CompressionLZ4
508 err := config.Validate()
509 var target ConfigurationError
510 if !errors.As(err, &target) || string(target) != "lz4 compression requires Version >= V0_10_0_0" {
511 t.Error("Expected invalid lz4/kafka version error, got ", err)
512 }
513 config.Version = V0_10_0_0
514 if err := config.Validate(); err != nil {
515 t.Error("Expected lz4 to work, got ", err)
516 }
517}
518
519func TestZstdConfigValidation(t *testing.T) {
520 config := NewTestConfig()

Callers

nothing calls this directly

Calls 3

ValidateMethod · 0.80
NewTestConfigFunction · 0.70
ErrorMethod · 0.65

Tested by

no test coverage detected