fix(test): fix DocumentServiceTest + EmailServiceTest for CI green
CI — Build, Lint & Security Scan / backend (push) Failing after 1m31s
CI — Build, Lint & Security Scan / frontend (push) Failing after 36s
CI — Build, Lint & Security Scan / image-scan (push) Has been skipped
CI — Build, Lint & Security Scan / secrets-scan (push) Failing after 12s
Deploy to TrueNAS / deploy (push) Failing after 39s
CI — Build, Lint & Security Scan / backend (push) Failing after 1m31s
CI — Build, Lint & Security Scan / frontend (push) Failing after 36s
CI — Build, Lint & Security Scan / image-scan (push) Has been skipped
CI — Build, Lint & Security Scan / secrets-scan (push) Failing after 12s
Deploy to TrueNAS / deploy (push) Failing after 39s
- DocumentServiceTest: add missing @Mock StorageQuotaService (required after Sprint 12) - DocumentServiceTest: add fileSize to mock Document in delete test - EmailServiceTest: align assertion with actual exception message
This commit is contained in:
@@ -40,6 +40,9 @@ class DocumentServiceTest {
|
|||||||
@Mock
|
@Mock
|
||||||
private AuditService auditService;
|
private AuditService auditService;
|
||||||
|
|
||||||
|
@Mock
|
||||||
|
private StorageQuotaService storageQuotaService;
|
||||||
|
|
||||||
@InjectMocks
|
@InjectMocks
|
||||||
private DocumentService documentService;
|
private DocumentService documentService;
|
||||||
|
|
||||||
@@ -234,6 +237,7 @@ class DocumentServiceTest {
|
|||||||
doc.setId(docId);
|
doc.setId(docId);
|
||||||
doc.setClubId(clubId);
|
doc.setClubId(clubId);
|
||||||
doc.setTitle("To Delete");
|
doc.setTitle("To Delete");
|
||||||
|
doc.setFileSize(1024L);
|
||||||
doc.setStoragePath(clubId + "/" + docId + "_test.pdf");
|
doc.setStoragePath(clubId + "/" + docId + "_test.pdf");
|
||||||
when(documentRepository.findById(docId)).thenReturn(Optional.of(doc));
|
when(documentRepository.findById(docId)).thenReturn(Optional.of(doc));
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,6 @@ class EmailServiceTest {
|
|||||||
assertThatThrownBy(() ->
|
assertThatThrownBy(() ->
|
||||||
emailService.sendInviteEmail("fail@example.com", "Fail User", "Club", "token123"))
|
emailService.sendInviteEmail("fail@example.com", "Fail User", "Club", "token123"))
|
||||||
.isInstanceOf(RuntimeException.class)
|
.isInstanceOf(RuntimeException.class)
|
||||||
.hasMessageContaining("Failed to send invite email");
|
.hasMessageContaining("Failed to send email");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user