fixed a test with saving files without password, was expecting a password to be present

This commit is contained in:
Rostislav Raykov
2024-10-15 13:30:36 +03:00
parent aeba74f0bc
commit 6fe0cb030d

View File

@@ -44,7 +44,9 @@ public class FileServiceTests {
when(file.getSize()).thenReturn(1024L);
when(file.getBytes()).thenReturn("test content".getBytes());
when(fileRepository.save(any(FileEntity.class))).thenReturn(getFileEntity());
FileEntity fileEntity = getFileEntity();
fileEntity.passwordHash = null;
when(fileRepository.save(any(FileEntity.class))).thenReturn(fileEntity);
FileEntity result = fileService.saveFile(file, getFileUploadRequest());