mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-23 00:46:23 +01:00
67a55b89a4
Co-authored-by: Andrii Chubatiuk <wachy@Andriis-MBP-2.lan> Co-authored-by: Aliaksandr Valialkin <valyala@victoriametrics.com>
17 lines
353 B
Go
17 lines
353 B
Go
package firehose
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestProcessRequestBody(t *testing.T) {
|
|
data := []byte(`{"records": [{"data": "SGVsbG8sIA=="}, {"data": "d29ybGQh"}]}`)
|
|
err := ProcessRequestBody(&data)
|
|
if err != nil {
|
|
t.Fatalf("unexpected error: %v", err)
|
|
}
|
|
if string(data) != "Hello, world!" {
|
|
t.Fatalf("unexpected string: %q", string(data))
|
|
}
|
|
}
|