@@ -4,10 +4,13 @@ package test_test
44
55import (
66 "context"
7- "math/rand"
7+ "crypto/rand"
8+ "math/big"
89 "testing"
910 "time"
1011
12+ "github.com/stretchr/testify/suite"
13+
1114 "github.com/hellofresh/goengine"
1215 "github.com/hellofresh/goengine/driver/sql/postgres"
1316 "github.com/hellofresh/goengine/metadata"
@@ -16,7 +19,6 @@ import (
1619 strategySQL "github.com/hellofresh/goengine/strategy/json/sql"
1720 strategyPostgres "github.com/hellofresh/goengine/strategy/json/sql/postgres"
1821 "github.com/hellofresh/goengine/test/internal"
19- "github.com/stretchr/testify/suite"
2022)
2123
2224type (
@@ -342,14 +344,18 @@ func (s *eventStoreTestSuite) generateAppendMessages(aggregateIDs []goengine.UUI
342344 if i > 2 {
343345 boolVal = false
344346 }
347+
348+ randInt , err := rand .Int (rand .Reader , big .NewInt (100 ))
349+ s .Require ().NoError (err )
350+
345351 meta := s .appendMeta (map [string ]interface {}{
346352 "_aggregate_version" : i + 1 ,
347353 "_aggregate_version_less_then_4" : boolVal ,
348354 "_aggregate_type" : "basic" ,
349355 "_aggregate_id" : aggregateID .String (),
350- "_float_val" : float64 (i ) + float64 ( 3.12 ) ,
351- "rand_int" : rand . Intn ( 100 ),
352- "rand_float_32" : rand . Float32 ( ),
356+ "_float_val" : float64 (i ) + 3.12 ,
357+ "rand_int" : randInt . Int64 ( ),
358+ "rand_float_32" : float32 ( randInt . Int64 () / 100 ),
353359 "';''; DROP DATABASE events_orders_load;" : "ok" ,
354360 })
355361 payload := & payloadData {Name : "alice" , Balance : i * 11 }
0 commit comments