Update AttemptCounterTest.java

This commit is contained in:
Ludy87 2025-08-10 12:30:13 +02:00
parent 0f0247f006
commit 1d9112ec63
No known key found for this signature in database
GPG Key ID: 92696155E0220F94

View File

@ -67,7 +67,7 @@ class AttemptCounterTest {
@Test @Test
@DisplayName( @DisplayName(
"increment(): increases attemptCount and updates lastAttemptTime (not less than" "increment(): increases attemptCount and updates lastAttemptTime (not less than"
+ " before)") + " before)")
void increment_shouldIncreaseCountAndUpdateTime() { void increment_shouldIncreaseCountAndUpdateTime() {
AttemptCounter counter = new AttemptCounter(); AttemptCounter counter = new AttemptCounter();
long prevTime = counter.getLastAttemptTime(); long prevTime = counter.getLastAttemptTime();
@ -127,7 +127,7 @@ class AttemptCounterTest {
@Test @Test
@DisplayName( @DisplayName(
"returns FALSE when time difference is exactly equal to window (implementation uses" "returns FALSE when time difference is exactly equal to window (implementation uses"
+ " '>')") + " '>')")
void shouldReturnFalseWhenExactlyWindow() { void shouldReturnFalseWhenExactlyWindow() {
AttemptCounter counter = new AttemptCounter(); AttemptCounter counter = new AttemptCounter();
long window = 200L; long window = 200L;
@ -188,7 +188,7 @@ class AttemptCounterTest {
@Test @Test
@DisplayName( @DisplayName(
"Multiple increments(): Count increases monotonically and timestamp remains" "Multiple increments(): Count increases monotonically and timestamp remains"
+ " monotonically non-decreasing") + " monotonically non-decreasing")
void multipleIncrements_shouldIncreaseMonotonically() { void multipleIncrements_shouldIncreaseMonotonically() {
AttemptCounter counter = new AttemptCounter(); AttemptCounter counter = new AttemptCounter();
long t1 = counter.getLastAttemptTime(); long t1 = counter.getLastAttemptTime();
@ -232,6 +232,6 @@ class AttemptCounterTest {
Integer.MIN_VALUE, Integer.MIN_VALUE,
counter.getAttemptCount(), counter.getAttemptCount(),
"After increment past MAX_VALUE, int overflows to MIN_VALUE (Java standard" "After increment past MAX_VALUE, int overflows to MIN_VALUE (Java standard"
+ " behavior)"); + " behavior)");
} }
} }