Merge branch 'RED-10511' into 'master'

RED-10511: False warnings when approving file appears after justification refactoring

Closes RED-10511

See merge request redactmanager/persistence-service!885
This commit is contained in:
Maverick Studer 2024-11-21 14:54:01 +01:00
commit f08a2d512a
2 changed files with 2 additions and 2 deletions

View File

@ -51,7 +51,7 @@ public class ApprovalVerificationService {
addWarning(entry, WarningType.LEGAL_BASIS_MISSING, approveResponse);
} else {
var legalBasisEntity = legalBasisMappings.stream()
.filter(mapping -> mapping.getReason().equals(entry.getLegalBasis()))
.filter(mapping -> mapping.getTechnicalName().equals(entry.getLegalBasis()))
.findFirst();
if (legalBasisEntity.isEmpty() || StringUtils.isEmpty(legalBasisEntity.get().getTechnicalName())) {
addWarning(entry, WarningType.UNMAPPED_JUSTIFICATION, approveResponse);

View File

@ -71,7 +71,7 @@ public class ApprovalTest extends AbstractPersistenceServerServiceTest {
.id("id1")
.positions(List.of(new Position(1, 1, 1, 1, 1)))
.state(EntryState.APPLIED)
.legalBasis("legalBasis")
.legalBasis("legal_basis")
.entryType(EntryType.ENTITY)
.value("value")
.build()));