RED-5724 - Pressing Reanalyze-Button should reset processing_error_counter
- reset the counter in state of REPROCESS
This commit is contained in:
parent
7c73aabfb1
commit
09fc65541f
@ -481,6 +481,7 @@ public class FileStatusPersistenceService {
|
|||||||
return fileRepository.findById(fileId).map(FileEntity::getProcessingErrorCounter).orElse(0) + 1;
|
return fileRepository.findById(fileId).map(FileEntity::getProcessingErrorCounter).orElse(0) + 1;
|
||||||
|
|
||||||
case PROCESSED:
|
case PROCESSED:
|
||||||
|
case REPROCESS:
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
@ -3,7 +3,9 @@ package com.iqser.red.service.peristence.v1.server.integration.tests;
|
|||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
import java.util.List;
|
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.junit.Test;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
@ -36,6 +38,9 @@ public class FileProcessingTest extends AbstractPersistenceServerServiceTest {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private UploadClient uploadClient;
|
private UploadClient uploadClient;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ReanalysisClient reanalysisClient;
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFileProcessing() {
|
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