Skip to content
This repository was archived by the owner on Oct 7, 2022. It is now read-only.

Commit d88706f

Browse files
author
Mateus Moury
committed
feat(fixtures): adding elasticrecord fixture
1 parent eacb06f commit d88706f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/kafka/fixtures/fixtures.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package fixtures
22

33
import (
4+
"strconv"
45
"time"
56

67
"math/rand"
@@ -48,3 +49,13 @@ func NewRecord(ts time.Time) (*models.Record, int32, int32) {
4849
Json: map[string]interface{}{"id": id, "value": value},
4950
}, id, value
5051
}
52+
53+
func NewElasticRecord() (*models.ElasticRecord, int32) {
54+
id := rand.Int31()
55+
return &models.ElasticRecord{
56+
Index: "dummy-index",
57+
Type: "dummy-type",
58+
ID: strconv.Itoa(int(id)),
59+
Json: map[string]interface{}{"id": id},
60+
}, id
61+
}

0 commit comments

Comments
 (0)