Pull request #588: RED-5724 - Pressing Reanalyze-Button should reset processing_error_counter
Merge in RED/persistence-service from bugfix/RED-5724 to master * commit '09fc65541f571d2938e5e1b2ee26859a4e832646': RED-5724 - Pressing Reanalyze-Button should reset processing_error_counter
This commit is contained in:
commit
733d41feac
@ -481,6 +481,7 @@ public class FileStatusPersistenceService {
|
||||
return fileRepository.findById(fileId).map(FileEntity::getProcessingErrorCounter).orElse(0) + 1;
|
||||
|
||||
case PROCESSED:
|
||||
case REPROCESS:
|
||||
return 0;
|
||||
|
||||
default:
|
||||
|
||||
@ -3,7 +3,9 @@ package com.iqser.red.service.peristence.v1.server.integration.tests;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.iqser.red.service.peristence.v1.server.integration.client.ReanalysisClient;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@ -36,6 +38,9 @@ public class FileProcessingTest extends AbstractPersistenceServerServiceTest {
|
||||
@Autowired
|
||||
private UploadClient uploadClient;
|
||||
|
||||
@Autowired
|
||||
private ReanalysisClient reanalysisClient;
|
||||
|
||||
|
||||
@Test
|
||||
public void testFileProcessing() {
|
||||
@ -203,4 +208,21 @@ public class FileProcessingTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFileProcessingInErrorStateAndReanalyise() {
|
||||
|
||||
var dossier = dossierTesterAndProvider.provideTestDossier();
|
||||
|
||||
var file = fileTesterAndProvider.testAndProvideFile(dossier);
|
||||
|
||||
fileProcessingClient.analysisFailed(dossier.getId(), file.getId());
|
||||
var loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getProcessingStatus()).isEqualTo(ProcessingStatus.ERROR);
|
||||
|
||||
reanalysisClient.reanalyzeFiles(dossier.getId(), Set.of(loadedFile.getId()), true);
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getProcessingStatus()).isEqualTo(ProcessingStatus.FULL_PROCESSING);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user