Skip to content

Commit 90ebc33

Browse files
Address code review comments - update author and add comments
Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
1 parent 87853cd commit 90ebc33

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

xapi-model/src/test/java/dev/learning/xapi/model/ResultDurationValidationTests.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* validates durations and is not vulnerable to ReDoS (Regular Expression Denial of Service)
2626
* attacks.
2727
*
28-
* @author GitHub Copilot
28+
* @author Berry Cloud
2929
*/
3030
@DisplayName("Result Duration Validation Tests")
3131
class ResultDurationValidationTests {
@@ -162,6 +162,7 @@ void whenDurationHasManyDigitsThenValidationCompletesQuickly() {
162162

163163
// Then Validation Passes And Completes In Reasonable Time
164164
assertThat(violations, empty());
165+
// Validation should complete quickly - 100ms is generous for a regex match
165166
assertThat("Validation should complete in less than 100ms", durationMs < 100);
166167
}
167168

@@ -183,6 +184,7 @@ void whenDurationIsAdversarialInputThenValidationCompletesQuicklyWithoutReDoS()
183184

184185
// Then Validation Fails Quickly (not vulnerable to ReDoS)
185186
assertThat(violations, not(empty()));
187+
// Validation should complete quickly even with adversarial input - 100ms is generous
186188
assertThat("Validation should complete in less than 100ms even with adversarial input",
187189
durationMs < 100);
188190
}
@@ -204,6 +206,7 @@ void whenDurationHasMultipleOptionalGroupsThenValidationCompletesQuickly() {
204206

205207
// Then Validation Fails Quickly Without Excessive Backtracking
206208
assertThat(violations, not(empty()));
209+
// Validation should complete quickly - 100ms is generous for a regex match
207210
assertThat("Validation should complete in less than 100ms", durationMs < 100);
208211
}
209212
}

0 commit comments

Comments
 (0)