Skip to content

Commit

Permalink
[CLOUDTRUST-5142] Reminders management for all authenticators
Browse files Browse the repository at this point in the history
[CLOUDTRUST-5142] Add helpers to substract long duration to a given date/time
Convert interface{} to any
  • Loading branch information
fperot74 committed May 1, 2024
1 parent 8901a69 commit 7de4701
Show file tree
Hide file tree
Showing 35 changed files with 134 additions and 104 deletions.
8 changes: 4 additions & 4 deletions configuration/module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestGetRealmConfigurations(t *testing.T) {
})
t.Run("Invalid JSON", func(t *testing.T) {
mockDB.EXPECT().QueryRow(gomock.Any(), realmID).Return(mockSQLRow)
mockSQLRow.EXPECT().Scan(gomock.Any()).DoAndReturn(func(dest ...interface{}) error {
mockSQLRow.EXPECT().Scan(gomock.Any()).DoAndReturn(func(dest ...any) error {
*(dest[0]).(*string) = `{`
*(dest[1]).(*string) = `{}`
return nil
Expand All @@ -48,7 +48,7 @@ func TestGetRealmConfigurations(t *testing.T) {
})
t.Run("Success", func(t *testing.T) {
mockDB.EXPECT().QueryRow(gomock.Any(), realmID).Return(mockSQLRow)
mockSQLRow.EXPECT().Scan(gomock.Any()).DoAndReturn(func(dest ...interface{}) error {
mockSQLRow.EXPECT().Scan(gomock.Any()).DoAndReturn(func(dest ...any) error {
*(dest[0]).(*string) = `{}`
*(dest[1]).(*string) = `{}`
return nil
Expand Down Expand Up @@ -167,7 +167,7 @@ func TestGetAuthorizations(t *testing.T) {
t.Run("Query returns 2 rows", func(t *testing.T) {
gomock.InOrder(
mockSQLRows.EXPECT().Next().Return(true),
mockSQLRows.EXPECT().Scan(gomock.Any()).DoAndReturn(func(dest ...interface{}) error {
mockSQLRows.EXPECT().Scan(gomock.Any()).DoAndReturn(func(dest ...any) error {
*(dest[0]).(*string) = "realm#1"
*(dest[1]).(*string) = "group#1"
*(dest[2]).(*string) = notInScopeAction
Expand All @@ -176,7 +176,7 @@ func TestGetAuthorizations(t *testing.T) {
return nil
}),
mockSQLRows.EXPECT().Next().Return(true),
mockSQLRows.EXPECT().Scan(gomock.Any()).DoAndReturn(func(dest ...interface{}) error {
mockSQLRows.EXPECT().Scan(gomock.Any()).DoAndReturn(func(dest ...any) error {
*(dest[0]).(*string) = "realm#2"
*(dest[1]).(*string) = "group#2"
*(dest[2]).(*string) = allowedAction
Expand Down
16 changes: 8 additions & 8 deletions convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ const (
layout = "02.01.2006"
)

// ToTimePtr converts an interface{} value as a Time pointer. Error is not possible, defaults to nil
func ToTimePtr(value interface{}) *time.Time {
// ToTimePtr converts an 'any' value as a Time pointer. Error is not possible, defaults to nil
func ToTimePtr(value any) *time.Time {
if value == nil {
return nil
}
Expand All @@ -30,8 +30,8 @@ func ToTimePtr(value interface{}) *time.Time {
return nil
}

// ToStringPtr converts an interface{} value as a string pointer
func ToStringPtr(value interface{}) *string {
// ToStringPtr converts an 'any' value as a string pointer
func ToStringPtr(value any) *string {
if value == nil {
return nil
}
Expand All @@ -43,8 +43,8 @@ func ToStringPtr(value interface{}) *string {
return &res
}

// ToInt converts an interface{} value as int and returns a default value in case of error
func ToInt(value interface{}, defaultValue int) int {
// ToInt converts an 'any' value as int and returns a default value in case of error
func ToInt(value any, defaultValue int) int {
switch v := value.(type) {
case int:
return v
Expand Down Expand Up @@ -75,8 +75,8 @@ func ToInt(value interface{}, defaultValue int) int {
}
}

// ToFloat converts an interface{} value as float64 and returns a default value in case of error
func ToFloat(value interface{}, defaultValue float64) float64 {
// ToFloat converts an 'any' value as float64 and returns a default value in case of error
func ToFloat(value any, defaultValue float64) float64 {
switch v := value.(type) {
case int:
return float64(v)
Expand Down
12 changes: 6 additions & 6 deletions database/dbase.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ func (db *basicCloudtrustDB) BeginTx(ctx context.Context, opts *sql.TxOptions) (
return NewTransaction(tx), nil
}

func (db *basicCloudtrustDB) Exec(query string, args ...interface{}) (sql.Result, error) {
func (db *basicCloudtrustDB) Exec(query string, args ...any) (sql.Result, error) {
return db.dbConn.Exec(query, args...)
}

func (db *basicCloudtrustDB) Query(query string, args ...interface{}) (sqltypes.SQLRows, error) {
func (db *basicCloudtrustDB) Query(query string, args ...any) (sqltypes.SQLRows, error) {
return db.dbConn.Query(query, args...)
}

func (db *basicCloudtrustDB) QueryRow(query string, args ...interface{}) sqltypes.SQLRow {
func (db *basicCloudtrustDB) QueryRow(query string, args ...any) sqltypes.SQLRow {
return db.dbConn.QueryRow(query, args...)
}

Expand Down Expand Up @@ -324,7 +324,7 @@ func (rcdb *ReconnectableCloudtrustDB) BeginTx(ctx context.Context, opts *sql.Tx
}

// Exec an SQL query
func (rcdb *ReconnectableCloudtrustDB) Exec(query string, args ...interface{}) (sql.Result, error) {
func (rcdb *ReconnectableCloudtrustDB) Exec(query string, args ...any) (sql.Result, error) {
rcdb.logger.Debug(context.TODO(), "msg", "'Exec() called'")
dbConn, err := rcdb.getActiveConnection()
if err != nil {
Expand All @@ -339,7 +339,7 @@ func (rcdb *ReconnectableCloudtrustDB) Exec(query string, args ...interface{}) (
}

// Query a multiple-rows SQL result
func (rcdb *ReconnectableCloudtrustDB) Query(query string, args ...interface{}) (sqltypes.SQLRows, error) {
func (rcdb *ReconnectableCloudtrustDB) Query(query string, args ...any) (sqltypes.SQLRows, error) {
rcdb.logger.Debug(context.TODO(), "msg", "'Query() called'")
dbConn, err := rcdb.getActiveConnection()
if err != nil {
Expand All @@ -354,7 +354,7 @@ func (rcdb *ReconnectableCloudtrustDB) Query(query string, args ...interface{})
}

// QueryRow a single-row SQL result
func (rcdb *ReconnectableCloudtrustDB) QueryRow(query string, args ...interface{}) sqltypes.SQLRow {
func (rcdb *ReconnectableCloudtrustDB) QueryRow(query string, args ...any) sqltypes.SQLRow {
rcdb.logger.Debug(context.TODO(), "msg", "'QueryRow() called'")
dbConn, err := rcdb.getActiveConnection()
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions database/dbase_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func TestCheckMigrationVersion(t *testing.T) {
// Current version is higher than the minimum version requirement
var version = "1.6"
mockDB.EXPECT().QueryRow(gomock.Any()).Return(row)
row.EXPECT().Scan(gomock.Any()).DoAndReturn(func(dest ...interface{}) error {
row.EXPECT().Scan(gomock.Any()).DoAndReturn(func(dest ...any) error {
var ptrVersion = dest[0].(*string)
*ptrVersion = version
return nil
Expand All @@ -121,7 +121,7 @@ func TestCheckMigrationVersion(t *testing.T) {
var row = mock.NewSQLRow(mockCtrl)
var version = "1.3"
mockDB.EXPECT().QueryRow(gomock.Any()).Return(row)
row.EXPECT().Scan(gomock.Any()).DoAndReturn(func(dest ...interface{}) error {
row.EXPECT().Scan(gomock.Any()).DoAndReturn(func(dest ...any) error {
var ptrVersion = dest[0].(*string)
*ptrVersion = version
return nil
Expand Down
2 changes: 1 addition & 1 deletion database/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func isInArray(array []string, value string) bool {
return false
}

func checkNull(value string) interface{} {
func checkNull(value string) any {
if value == "" {
return nil
}
Expand Down
10 changes: 5 additions & 5 deletions database/noop.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (r *NoopSQLRows) NextResultSet() bool { return false }
func (r *NoopSQLRows) Err() error { return nil }

// Scan implements SQLRows.Scan(...)
func (r *NoopSQLRows) Scan(dest ...interface{}) error { return nil }
func (r *NoopSQLRows) Scan(dest ...any) error { return nil }

// Close implements SQLRows.Close()
func (r *NoopSQLRows) Close() error { return nil }
Expand All @@ -29,7 +29,7 @@ func (r *NoopSQLRows) Close() error { return nil }
type NoopSQLRow struct{}

// Scan implements SQLRow.Scan(...)
func (r *NoopSQLRow) Scan(dest ...interface{}) error {
func (r *NoopSQLRow) Scan(dest ...any) error {
return nil
}

Expand All @@ -42,17 +42,17 @@ func (db *NoopDB) BeginTx(ctx context.Context, opts *sql.TxOptions) (sqltypes.Tr
}

// Exec does nothing.
func (db *NoopDB) Exec(query string, args ...interface{}) (sql.Result, error) {
func (db *NoopDB) Exec(query string, args ...any) (sql.Result, error) {
return NoopResult{}, nil
}

// Query does nothing.
func (db *NoopDB) Query(query string, args ...interface{}) (sqltypes.SQLRows, error) {
func (db *NoopDB) Query(query string, args ...any) (sqltypes.SQLRows, error) {
return &NoopSQLRows{}, nil
}

// QueryRow does nothing.
func (db *NoopDB) QueryRow(query string, args ...interface{}) sqltypes.SQLRow {
func (db *NoopDB) QueryRow(query string, args ...any) sqltypes.SQLRow {
return &NoopSQLRow{}
}

Expand Down
18 changes: 9 additions & 9 deletions database/sqltypes/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ type SQLRows interface {
Next() bool
NextResultSet() bool
Err() error
Scan(dest ...interface{}) error
Scan(dest ...any) error
Close() error
}

// SQLRow interface
type SQLRow interface {
Scan(dest ...interface{}) error
Scan(dest ...any) error
}

type sqlRowError struct {
Expand All @@ -28,16 +28,16 @@ func NewSQLRowError(err error) SQLRow {
return &sqlRowError{err: err}
}

func (sre *sqlRowError) Scan(dest ...interface{}) error {
func (sre *sqlRowError) Scan(dest ...any) error {
return sre.err
}

// CloudtrustDB interface
type CloudtrustDB interface {
BeginTx(ctx context.Context, opts *sql.TxOptions) (Transaction, error)
Exec(query string, args ...interface{}) (sql.Result, error)
Query(query string, args ...interface{}) (SQLRows, error)
QueryRow(query string, args ...interface{}) SQLRow
Exec(query string, args ...any) (sql.Result, error)
Query(query string, args ...any) (SQLRows, error)
QueryRow(query string, args ...any) SQLRow
Ping() error
Close() error
Stats() sql.DBStats
Expand All @@ -56,7 +56,7 @@ type Transaction interface {
// Close: if not explicitely Commited or Rolled back, Rollback the transaction
Close() error

Exec(query string, args ...interface{}) (sql.Result, error)
Query(query string, args ...interface{}) (SQLRows, error)
QueryRow(query string, args ...interface{}) SQLRow
Exec(query string, args ...any) (sql.Result, error)
Query(query string, args ...any) (SQLRows, error)
QueryRow(query string, args ...any) SQLRow
}
12 changes: 6 additions & 6 deletions database/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ type DbTransactionIntf interface {
Commit() error
Rollback() error

Exec(query string, args ...interface{}) (sql.Result, error)
Query(query string, args ...interface{}) (*sql.Rows, error)
QueryRow(query string, args ...interface{}) *sql.Row
Exec(query string, args ...any) (sql.Result, error)
Query(query string, args ...any) (*sql.Rows, error)
QueryRow(query string, args ...any) *sql.Row
}

// NewTransaction creates a transaction
Expand Down Expand Up @@ -49,14 +49,14 @@ func (tx *dbTransaction) Close() error {
return tx.Rollback()
}

func (tx *dbTransaction) Exec(query string, args ...interface{}) (sql.Result, error) {
func (tx *dbTransaction) Exec(query string, args ...any) (sql.Result, error) {
return tx.tx.Exec(query, args...)
}

func (tx *dbTransaction) Query(query string, args ...interface{}) (sqltypes.SQLRows, error) {
func (tx *dbTransaction) Query(query string, args ...any) (sqltypes.SQLRows, error) {
return tx.tx.Query(query, args...)
}

func (tx *dbTransaction) QueryRow(query string, args ...interface{}) sqltypes.SQLRow {
func (tx *dbTransaction) QueryRow(query string, args ...any) sqltypes.SQLRow {
return tx.tx.QueryRow(query, args...)
}
2 changes: 2 additions & 0 deletions events/kafkaproducer.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
)

// KafkaProducerConfig struct
// Deprecated: KafkaProducerConfig is deprecated. Use kafka-client instead
type KafkaProducerConfig struct {
Version string
Brokers []string
Expand All @@ -21,6 +22,7 @@ type KafkaProducerConfig struct {
}

// GetKafkaProducerConfig gets a KafkaProducerConfig
// Deprecated: GetKafkaProducerConfig is deprecated. Use kafka-client instead
func GetKafkaProducerConfig(c cs.Configuration, prefix string) KafkaProducerConfig {
var cfg KafkaProducerConfig

Expand Down
2 changes: 2 additions & 0 deletions events/noop.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
)

// NoopKafkaConsumerGroup is an consumer group that does nothing.
// Deprecated: NoopKafkaConsumerGroup is deprecated. Use the one implemented in kafka-client instead
type NoopKafkaConsumerGroup struct{}

// Consume does noop
Expand Down Expand Up @@ -37,6 +38,7 @@ func (n *NoopKafkaConsumerGroup) PauseAll() {}
func (n *NoopKafkaConsumerGroup) ResumeAll() {}

// NoopKafkaProducer struct
// Deprecated: NoopKafkaProducer is deprecated. Use the one implemented in kafka-client instead
type NoopKafkaProducer struct{}

// SendMessage does noop
Expand Down
1 change: 1 addition & 0 deletions events/saramalogger.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
cloudtrust_log "github.com/cloudtrust/common-service/v2/log"
)

// Deprecated: NewSaramaLogger is deprecated. Use the one implemented in kafka-client instead
func NewSaramaLogger(logger cloudtrust_log.Logger, enabled bool) sarama.StdLogger {
if enabled {
return log.New(&cloudtrustLoggerWrapper{logger}, "[Sarama] ", log.LstdFlags)
Expand Down
1 change: 1 addition & 0 deletions events/tokenprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type TokenProvider struct {
}

// NewTokenProvider creates an instance of sarama AccessTokenProvider
// Deprecated: NewTokenProvider is deprecated. Use the one implemented in kafka-client instead
func NewTokenProvider(clientID, clientSecret, tokenURL string) sarama.AccessTokenProvider {
cfg := clientcredentials.Config{
ClientID: clientID,
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/cloudtrust/common-service/v2

go 1.17
go 1.21.0

require (
github.com/IBM/sarama v1.41.1
Expand All @@ -18,7 +18,7 @@ require (
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.8.4
github.com/uber/jaeger-client-go v2.30.0+incompatible
golang.org/x/net v0.14.0
golang.org/x/net v0.24.0
golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a
gopkg.in/h2non/gentleman.v2 v2.0.5
)
Expand Down Expand Up @@ -49,9 +49,9 @@ require (
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/crypto v0.22.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/protobuf v1.27.1 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,8 @@ golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
Expand Down Expand Up @@ -588,6 +590,8 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
Expand Down Expand Up @@ -685,6 +689,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc=
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down Expand Up @@ -837,6 +843,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
2 changes: 1 addition & 1 deletion healthcheck/audit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestAuditEventsReporterChecker(t *testing.T) {
t.Run("Failure ", func(t *testing.T) {
var auditEventReporterChecker = newAuditEventsReporterChecker("alias", mockAuditEventReporter, 1*time.Second, 10*time.Second, log.NewNopLogger())
internalChecker := auditEventReporterChecker.(*auditEventsReporterChecker)
mockAuditEventReporter.EXPECT().ReportEvent(gomock.Any(), gomock.Any()).Do(func(arg0 interface{}, arg1 interface{}) {
mockAuditEventReporter.EXPECT().ReportEvent(gomock.Any(), gomock.Any()).Do(func(arg0 any, arg1 any) {
time.Sleep(2 * time.Second)
})

Expand Down
Loading

0 comments on commit 7de4701

Please sign in to comment.