|
|
@ -53,21 +53,21 @@ func TestIntegrationLoginAttemptsQuery(t *testing.T) { |
|
|
|
now: func() time.Time { return mockTime }, |
|
|
|
now: func() time.Time { return mockTime }, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
err := s.CreateLoginAttempt(context.Background(), CreateLoginAttemptCommand{ |
|
|
|
_, err := s.CreateLoginAttempt(context.Background(), CreateLoginAttemptCommand{ |
|
|
|
Username: user, |
|
|
|
Username: user, |
|
|
|
IpAddress: "192.168.0.1", |
|
|
|
IpAddress: "192.168.0.1", |
|
|
|
}) |
|
|
|
}) |
|
|
|
require.Nil(t, err) |
|
|
|
require.Nil(t, err) |
|
|
|
|
|
|
|
|
|
|
|
mockTime = timePlusOneMinute |
|
|
|
mockTime = timePlusOneMinute |
|
|
|
err = s.CreateLoginAttempt(context.Background(), CreateLoginAttemptCommand{ |
|
|
|
_, err = s.CreateLoginAttempt(context.Background(), CreateLoginAttemptCommand{ |
|
|
|
Username: user, |
|
|
|
Username: user, |
|
|
|
IpAddress: "192.168.0.1", |
|
|
|
IpAddress: "192.168.0.1", |
|
|
|
}) |
|
|
|
}) |
|
|
|
require.Nil(t, err) |
|
|
|
require.Nil(t, err) |
|
|
|
|
|
|
|
|
|
|
|
mockTime = timePlusTwoMinutes |
|
|
|
mockTime = timePlusTwoMinutes |
|
|
|
err = s.CreateLoginAttempt(context.Background(), CreateLoginAttemptCommand{ |
|
|
|
_, err = s.CreateLoginAttempt(context.Background(), CreateLoginAttemptCommand{ |
|
|
|
Username: user, |
|
|
|
Username: user, |
|
|
|
IpAddress: "192.168.0.1", |
|
|
|
IpAddress: "192.168.0.1", |
|
|
|
}) |
|
|
|
}) |
|
|
@ -118,21 +118,21 @@ func TestIntegrationLoginAttemptsDelete(t *testing.T) { |
|
|
|
now: func() time.Time { return mockTime }, |
|
|
|
now: func() time.Time { return mockTime }, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
err := s.CreateLoginAttempt(context.Background(), CreateLoginAttemptCommand{ |
|
|
|
_, err := s.CreateLoginAttempt(context.Background(), CreateLoginAttemptCommand{ |
|
|
|
Username: user, |
|
|
|
Username: user, |
|
|
|
IpAddress: "192.168.0.1", |
|
|
|
IpAddress: "192.168.0.1", |
|
|
|
}) |
|
|
|
}) |
|
|
|
require.Nil(t, err) |
|
|
|
require.Nil(t, err) |
|
|
|
|
|
|
|
|
|
|
|
mockTime = timePlusOneMinute |
|
|
|
mockTime = timePlusOneMinute |
|
|
|
err = s.CreateLoginAttempt(context.Background(), CreateLoginAttemptCommand{ |
|
|
|
_, err = s.CreateLoginAttempt(context.Background(), CreateLoginAttemptCommand{ |
|
|
|
Username: user, |
|
|
|
Username: user, |
|
|
|
IpAddress: "192.168.0.1", |
|
|
|
IpAddress: "192.168.0.1", |
|
|
|
}) |
|
|
|
}) |
|
|
|
require.Nil(t, err) |
|
|
|
require.Nil(t, err) |
|
|
|
|
|
|
|
|
|
|
|
mockTime = timePlusTwoMinutes |
|
|
|
mockTime = timePlusTwoMinutes |
|
|
|
err = s.CreateLoginAttempt(context.Background(), CreateLoginAttemptCommand{ |
|
|
|
_, err = s.CreateLoginAttempt(context.Background(), CreateLoginAttemptCommand{ |
|
|
|
Username: user, |
|
|
|
Username: user, |
|
|
|
IpAddress: "192.168.0.1", |
|
|
|
IpAddress: "192.168.0.1", |
|
|
|
}) |
|
|
|
}) |
|
|
|