test improvements for new features

This commit is contained in:
Timo Bejan 2021-10-04 07:44:50 +03:00
parent 1a3e10a04e
commit daadcf09c7
2 changed files with 9 additions and 3 deletions

View File

@ -45,7 +45,6 @@ public class ManualRedactionEntryEntity {
@Column
private OffsetDateTime softDeletedTime;
@ElementCollection
private List<RectangleEntity> positions = new ArrayList<>();

View File

@ -42,15 +42,22 @@ public class FileTesterAndProvider {
@SneakyThrows
public FileModel testAndProvideFile(Dossier dossier) {
return testAndProvideFile(dossier, "test.pdf");
}
BinaryFileRequest upload = new BinaryFileRequest("test".getBytes(StandardCharsets.UTF_8), "test.pdf", dossier.getId(), "1");
@SneakyThrows
public FileModel testAndProvideFile(Dossier dossier, String fileName) {
BinaryFileRequest upload = new BinaryFileRequest("test".getBytes(StandardCharsets.UTF_8), fileName, dossier.getId(), "1");
JSONPrimitive<String> uploadResult = uploadClient.upload(upload);
var file = fileClient.getFileStatus(dossier.getId(), uploadResult.getValue());
assertThat(file.getId()).isNotBlank();
assertThat(fileClient.getDossierStatus(dossier.getId()).size()).isEqualTo(1);
assertThat(fileClient.getDossierStatus(dossier.getId()).size()).isGreaterThanOrEqualTo(1);
fileManagementStorageService.storeObject(dossier.getId(), file.getId(), FileType.REDACTION_LOG, objectMapper.writeValueAsBytes(new RedactionLog(1, List.of(RedactionLogEntry.builder().id("annotationId").type("manual").value("value").build()),
null, 0, 0, 0, 0)));