Pull request #107: RED-2441: Fixed dossierTemplateId is null for soft deleted files

Merge in RED/persistence-service from RED-2441 to master

* commit 'd5b70932b2466e434f3e8a7a735fda7b8fb520ef':
  RED-2441: Fixed dossierTemplateId is null for soft deleted files
This commit is contained in:
Dominique Eiflaender 2021-11-08 14:35:49 +01:00
commit f0f9109abf
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);