|
@@ -4,11 +4,9 @@ import "testing"
|
|
|
|
|
|
|
|
var (
|
|
var (
|
|
|
emptyOffsetCommitResponse = []byte{
|
|
emptyOffsetCommitResponse = []byte{
|
|
|
- 0xFF, 0xFF,
|
|
|
|
|
0x00, 0x00, 0x00, 0x00}
|
|
0x00, 0x00, 0x00, 0x00}
|
|
|
|
|
|
|
|
normalOffsetCommitResponse = []byte{
|
|
normalOffsetCommitResponse = []byte{
|
|
|
- 0x00, 0x02, 'a', 'z',
|
|
|
|
|
0x00, 0x00, 0x00, 0x02,
|
|
0x00, 0x00, 0x00, 0x02,
|
|
|
|
|
|
|
|
0x00, 0x01, 'm',
|
|
0x00, 0x01, 'm',
|
|
@@ -24,9 +22,7 @@ func TestEmptyOffsetCommitResponse(t *testing.T) {
|
|
|
response := OffsetCommitResponse{}
|
|
response := OffsetCommitResponse{}
|
|
|
|
|
|
|
|
testDecodable(t, "empty", &response, emptyOffsetCommitResponse)
|
|
testDecodable(t, "empty", &response, emptyOffsetCommitResponse)
|
|
|
- if response.ClientID != "" {
|
|
|
|
|
- t.Error("Decoding produced client ID where there was none.")
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
if len(response.Errors) != 0 {
|
|
if len(response.Errors) != 0 {
|
|
|
t.Error("Decoding produced errors where there were none.")
|
|
t.Error("Decoding produced errors where there were none.")
|
|
|
}
|
|
}
|
|
@@ -36,9 +32,6 @@ func TestNormalOffsetCommitResponse(t *testing.T) {
|
|
|
response := OffsetCommitResponse{}
|
|
response := OffsetCommitResponse{}
|
|
|
|
|
|
|
|
testDecodable(t, "normal", &response, normalOffsetCommitResponse)
|
|
testDecodable(t, "normal", &response, normalOffsetCommitResponse)
|
|
|
- if response.ClientID != "az" {
|
|
|
|
|
- t.Error("Decoding produced wrong client ID.")
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
if len(response.Errors) != 2 {
|
|
if len(response.Errors) != 2 {
|
|
|
t.Fatal("Decoding produced wrong number of errors.")
|
|
t.Fatal("Decoding produced wrong number of errors.")
|