📁 pre-commit

Signed-off-by: stirlingbot[bot] <stirlingbot[bot]@users.noreply.github.com>
This commit is contained in:
stirlingbot[bot] 2025-07-28 00:18:22 +00:00 committed by GitHub
parent 054bf15b24
commit 65717d305d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 8 deletions

View File

@ -25,12 +25,12 @@ class CustomHtmlSanitizerTest {
SsrfProtectionService mockSsrfProtectionService = mock(SsrfProtectionService.class);
stirling.software.common.model.ApplicationProperties mockApplicationProperties = mock(stirling.software.common.model.ApplicationProperties.class);
stirling.software.common.model.ApplicationProperties.System mockSystem = mock(stirling.software.common.model.ApplicationProperties.System.class);
// Allow all URLs by default for basic tests
when(mockSsrfProtectionService.isUrlAllowed(org.mockito.ArgumentMatchers.anyString())).thenReturn(true);
when(mockApplicationProperties.getSystem()).thenReturn(mockSystem);
when(mockSystem.getDisableSanitize()).thenReturn(false); // Enable sanitization for tests
customHtmlSanitizer = new CustomHtmlSanitizer(mockSsrfProtectionService, mockApplicationProperties);
}

View File

@ -47,11 +47,11 @@ class EmlToPdfTest {
SsrfProtectionService mockSsrfProtectionService = mock(SsrfProtectionService.class);
stirling.software.common.model.ApplicationProperties mockApplicationProperties = mock(stirling.software.common.model.ApplicationProperties.class);
stirling.software.common.model.ApplicationProperties.System mockSystem = mock(stirling.software.common.model.ApplicationProperties.System.class);
when(mockSsrfProtectionService.isUrlAllowed(org.mockito.ArgumentMatchers.anyString())).thenReturn(true);
when(mockApplicationProperties.getSystem()).thenReturn(mockSystem);
when(mockSystem.getDisableSanitize()).thenReturn(false);
customHtmlSanitizer = new CustomHtmlSanitizer(mockSsrfProtectionService, mockApplicationProperties);
}
@ -588,7 +588,7 @@ class EmlToPdfTest {
}
@Test
@Disabled("Complex static mocking - temporarily disabled while refactoring")
@Disabled("Complex static mocking - temporarily disabled while refactoring")
@DisplayName("Should convert EML to PDF with attachments when requested")
void convertEmlToPdfWithAttachments() throws Exception {
String boundary = "----=_Part_1234567890";
@ -671,7 +671,7 @@ class EmlToPdfTest {
@Test
@Disabled("Complex static mocking - temporarily disabled while refactoring")
@DisplayName("Should handle errors during EML to PDF conversion")
@DisplayName("Should handle errors during EML to PDF conversion")
void handleErrorsDuringConversion() {
String emlContent =
createSimpleTextEmail("from@test.com", "to@test.com", "Subject", "Body");

View File

@ -26,11 +26,11 @@ public class FileToPdfTest {
SsrfProtectionService mockSsrfProtectionService = mock(SsrfProtectionService.class);
stirling.software.common.model.ApplicationProperties mockApplicationProperties = mock(stirling.software.common.model.ApplicationProperties.class);
stirling.software.common.model.ApplicationProperties.System mockSystem = mock(stirling.software.common.model.ApplicationProperties.System.class);
when(mockSsrfProtectionService.isUrlAllowed(org.mockito.ArgumentMatchers.anyString())).thenReturn(true);
when(mockApplicationProperties.getSystem()).thenReturn(mockSystem);
when(mockSystem.getDisableSanitize()).thenReturn(false);
customHtmlSanitizer = new CustomHtmlSanitizer(mockSsrfProtectionService, mockApplicationProperties);
}