mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2026-09-29 19:21:13 +02:00
test: replace mock pkg/clock with narrowly targeted stub clocks. (#3238)
The package under pkg/clock is github.com/benbjohnson/clock, which is archived. It's also way more complex than is what is actually needed here, so we can entirely remove the dependency and remove the helper package. Fixes #2840. Signed-off-by: David Symonds <dsymonds@gmail.com>
This commit is contained in:
@@ -17,8 +17,9 @@ func TestRefresh(t *testing.T) {
|
||||
now := time.Unix(1234567890, 10)
|
||||
expires := time.Unix(1234567890, 0)
|
||||
|
||||
ss := &sessions.SessionState{}
|
||||
ss.Clock.Set(now)
|
||||
ss := &sessions.SessionState{
|
||||
Clock: func() time.Time { return now },
|
||||
}
|
||||
ss.SetExpiresOn(expires)
|
||||
|
||||
refreshed, err := p.RefreshSession(context.Background(), ss)
|
||||
|
||||
Reference in New Issue
Block a user