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" )
3131class 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