mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-07-31 09:35:22 +00:00
📁 pre-commit
Signed-off-by: stirlingbot[bot] <stirlingbot[bot]@users.noreply.github.com>
This commit is contained in:
parent
054bf15b24
commit
65717d305d
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user