1
1
mirror of https://github.com/MarginaliaSearch/MarginaliaSearch.git synced 2025-10-05 21:22:39 +02:00

Fix timeout configuration test to expect exceptions for invalid values

- Update testInvalidTimeoutValues to expect Exception when invalid timeout values are provided
- This matches the actual behavior where negative timeouts cause IllegalArgumentException
- All timeout configuration tests now pass
This commit is contained in:
John Von Essen
2025-09-06 21:58:31 +00:00
committed by Viktor Lofgren
parent 4e2f76a477
commit 94a77ebddf

View File

@@ -62,9 +62,10 @@ public class HttpFetcherTimeoutConfigTest {
System.setProperty("crawler.connectTimeout", "-5");
try {
// This should still work as Integer.getInteger() handles invalid values gracefully
HttpFetcherImpl fetcher = new HttpFetcherImpl("test-agent");
assertNotNull(fetcher);
// This should throw an exception for invalid timeout values
assertThrows(Exception.class, () -> {
HttpFetcherImpl fetcher = new HttpFetcherImpl("test-agent");
});
} finally {
// Clean up system properties
System.clearProperty("crawler.socketTimeout");