RED-2441: Fixed dossierTemplateId is null for soft deleted files

This commit is contained in:
deiflaender 2021-11-08 14:18:49 +01:00
parent 952a61cb21
commit d5b70932b2
2 changed files with 5 additions and 0 deletions

View File

@ -13,5 +13,9 @@ public class FileModelMapper implements BiConsumer<FileEntity, FileModel> {
fileEntity.getFileAttributes().forEach(fa ->
fileModel.getFileAttributes().put(fa.getFileAttributeId().getFileAttributeConfigId(), fa.getValue())
);
// Without this dossierTemplateId is not set for soft-deleted documents calling get softdeleted with curl.
// however in the unittest it always null without it. Strange....
fileModel.setDossierTemplateId(fileEntity.getDossier().getDossierTemplateId());
}
}

View File

@ -137,6 +137,7 @@ public class FileTest extends AbstractPersistenceServerServiceTest {
var softDeletedFiles = fileClient.getSoftDeletedDossierStatus(dossier.getId());
assertThat(softDeletedFiles.size()).isEqualTo(1);
assertThat(softDeletedFiles.get(0).getDossierTemplateId()).isNotNull();
var activeFiles = fileClient.getDossierStatus(dossier.getId());
assertThat(activeFiles.size()).isEqualTo(0);