Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions api/client/events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ package client

import (
"testing"
"time"

"github.com/jonboulle/clockwork"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/proto"

Expand All @@ -32,6 +32,7 @@ import (
// primarily to catch potential issues with using our "mixed" gogo + regular protobuf
// strategy.
func TestEventEqual(t *testing.T) {
clock := clockwork.NewFakeClock()
app1, err := types.NewAppV3(types.Metadata{
Name: "app1",
}, types.AppSpecV3{
Expand All @@ -56,8 +57,8 @@ func TestEventEqual(t *testing.T) {
})
require.NoError(t, err)

accessList1 := newAccessList(t, "1")
accessList2 := newAccessList(t, "2")
accessList1 := newAccessList(t, "1", clock)
accessList2 := newAccessList(t, "2", clock)

tests := []struct {
name string
Expand Down Expand Up @@ -158,7 +159,7 @@ func TestEventEqual(t *testing.T) {
}
}

func newAccessList(t *testing.T, name string) *accesslist.AccessList {
func newAccessList(t *testing.T, name string, clock clockwork.Clock) *accesslist.AccessList {
t.Helper()

accessList, err := accesslist.NewAccessList(
Expand All @@ -179,7 +180,7 @@ func newAccessList(t *testing.T, name string) *accesslist.AccessList {
},
},
Audit: accesslist.Audit{
Frequency: time.Hour,
NextAuditDate: clock.Now(),
},
MembershipRequires: accesslist.Requires{
Roles: []string{"mrole1", "mrole2"},
Expand Down
Loading