Prepared codebase for auditor:request-scoped version variant. This was required to have the Feign backed tests working again.
This commit is contained in:
parent
3c5d62c12f
commit
4eddd50193
@ -41,7 +41,8 @@
|
||||
@RequiredArgsConstructor
|
||||
public class DictionaryController implements DictionaryResource {
|
||||
|
||||
private final DictionaryService dictionaryService;
|
||||
private final DictionaryService dictionaryService;
|
||||
private final Auditor auditor;
|
||||
|
||||
@Override
|
||||
public void addEntry(@PathVariable(TYPE_PARAMETER_NAME) String type,
|
||||
@ -49,8 +50,7 @@ public class DictionaryController implements DictionaryResource {
|
||||
@RequestBody List<String> entries,
|
||||
@RequestParam(name = REMOVE_CURRENT_REQUEST_PARAM, defaultValue = "false", required = false) boolean removeCurrent,
|
||||
@RequestParam(value = DOSSIER_ID_PARAMETER_NAME, required = false) String dossierId,
|
||||
@RequestParam(value = DICTIONARY_ENTRY_TYPE_PARAM, required = false, defaultValue = DEFAULT_DICTIONARY_ENTRY_TYPE) DictionaryEntryType dictionaryEntryType,
|
||||
Auditor auditor) {
|
||||
@RequestParam(value = DICTIONARY_ENTRY_TYPE_PARAM, required = false, defaultValue = DEFAULT_DICTIONARY_ENTRY_TYPE) DictionaryEntryType dictionaryEntryType) {
|
||||
|
||||
addEntries(type, dossierTemplateId, entries, removeCurrent, dossierId, dictionaryEntryType);
|
||||
auditor.audit(AuditCategory.DICTIONARY.name(), "Dictionary entries were added.",
|
||||
@ -73,10 +73,9 @@ public class DictionaryController implements DictionaryResource {
|
||||
@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId,
|
||||
@PathVariable(ENTRY_PARAMETER_NAME) String entry,
|
||||
@RequestParam(value = DOSSIER_ID_PARAMETER_NAME, required = false) String dossierId,
|
||||
@RequestParam(value = DICTIONARY_ENTRY_TYPE_PARAM, required = false, defaultValue = DEFAULT_DICTIONARY_ENTRY_TYPE) DictionaryEntryType dictionaryEntryType,
|
||||
Auditor auditor) {
|
||||
@RequestParam(value = DICTIONARY_ENTRY_TYPE_PARAM, required = false, defaultValue = DEFAULT_DICTIONARY_ENTRY_TYPE) DictionaryEntryType dictionaryEntryType) {
|
||||
|
||||
deleteEntries(type, dossierTemplateId, Arrays.asList(entry), dossierId, dictionaryEntryType, auditor);
|
||||
deleteEntries(type, dossierTemplateId, Arrays.asList(entry), dossierId, dictionaryEntryType);
|
||||
auditor.audit(AuditCategory.DICTIONARY.name(), "Dictionary entry was deleted.",
|
||||
d(AuditDetail.DOSSIER_TEMPLATE_ID, dossierTemplateId), d(AuditDetail.TYPE, type), d(AuditDetail.VALUE, entry));
|
||||
}
|
||||
@ -87,8 +86,7 @@ public class DictionaryController implements DictionaryResource {
|
||||
@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId,
|
||||
@RequestBody List<String> entries,
|
||||
@RequestParam(value = DOSSIER_ID_PARAMETER_NAME, required = false) String dossierId,
|
||||
@RequestParam(value = DICTIONARY_ENTRY_TYPE_PARAM, required = false, defaultValue = DEFAULT_DICTIONARY_ENTRY_TYPE) DictionaryEntryType dictionaryEntryType,
|
||||
Auditor auditor) {
|
||||
@RequestParam(value = DICTIONARY_ENTRY_TYPE_PARAM, required = false, defaultValue = DEFAULT_DICTIONARY_ENTRY_TYPE) DictionaryEntryType dictionaryEntryType) {
|
||||
|
||||
if (dossierId == null) {
|
||||
dictionaryService.deleteGlobalEntries(type, dossierTemplateId, entries, dictionaryEntryType);
|
||||
@ -103,7 +101,7 @@ public class DictionaryController implements DictionaryResource {
|
||||
@Override
|
||||
public void updateType(@PathVariable(TYPE_PARAMETER_NAME) String type,
|
||||
@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId,
|
||||
@RequestBody UpdateTypeValue typeValue, Auditor auditor) {
|
||||
@RequestBody UpdateTypeValue typeValue) {
|
||||
|
||||
dictionaryService.updateGlobalType(type, dossierTemplateId, typeValue);
|
||||
|
||||
@ -113,7 +111,7 @@ public class DictionaryController implements DictionaryResource {
|
||||
|
||||
|
||||
@Override
|
||||
public TypeValue addType(@Valid @RequestBody CreateTypeValue typeValue, Auditor auditor) {
|
||||
public TypeValue addType(@Valid @RequestBody CreateTypeValue typeValue) {
|
||||
|
||||
Type result = dictionaryService.addGlobalType(typeValue);
|
||||
|
||||
@ -126,7 +124,7 @@ public class DictionaryController implements DictionaryResource {
|
||||
|
||||
@Override
|
||||
public void deleteType(@PathVariable(TYPE_PARAMETER_NAME) String type,
|
||||
@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, Auditor auditor) {
|
||||
@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId) {
|
||||
|
||||
dictionaryService.deleteGlobalType(type, dossierTemplateId);
|
||||
|
||||
@ -137,7 +135,7 @@ public class DictionaryController implements DictionaryResource {
|
||||
|
||||
@Override
|
||||
public void deleteTypes(@RequestBody List<String> types,
|
||||
@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, Auditor auditor) {
|
||||
@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId) {
|
||||
|
||||
List<String> errorIds = new ArrayList<>();
|
||||
|
||||
@ -179,8 +177,7 @@ public class DictionaryController implements DictionaryResource {
|
||||
@PathVariable(TYPE_PARAMETER_NAME) String type,
|
||||
@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId,
|
||||
@RequestParam(value = DOSSIER_ID_PARAMETER_NAME, required = false) String dossierId,
|
||||
@RequestParam(value = DICTIONARY_ENTRY_TYPE_PARAM, required = false, defaultValue = DEFAULT_DICTIONARY_ENTRY_TYPE) DictionaryEntryType dictionaryEntryType,
|
||||
Auditor auditor) {
|
||||
@RequestParam(value = DICTIONARY_ENTRY_TYPE_PARAM, required = false, defaultValue = DEFAULT_DICTIONARY_ENTRY_TYPE) DictionaryEntryType dictionaryEntryType) {
|
||||
|
||||
validateFile(file);
|
||||
|
||||
@ -251,7 +248,7 @@ public class DictionaryController implements DictionaryResource {
|
||||
|
||||
|
||||
@Override
|
||||
public void setColors(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, @RequestBody Colors colors, Auditor auditor) {
|
||||
public void setColors(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, @RequestBody Colors colors) {
|
||||
|
||||
dictionaryService.setColors(dossierTemplateId, colors);
|
||||
|
||||
|
||||
@ -29,6 +29,7 @@ import static com.iqser.red.service.persistence.management.v1.processor.roles.Ac
|
||||
public class DigitalSignatureController implements DigitalSignatureResource {
|
||||
|
||||
private static final String DIGITAL_SIGNATURE_AUDIT_ID = "DigitalSignature";
|
||||
private final Auditor auditor;
|
||||
private final DigitalSignatureTypeService digitalSignatureTypeService;
|
||||
private final DigitalSignatureService digitalSignatureService;
|
||||
private final DigitalSignatureKmsService digitalSignatureKmsService;
|
||||
@ -44,7 +45,7 @@ public class DigitalSignatureController implements DigitalSignatureResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + WRITE_DIGITAL_SIGNATURE + "')")
|
||||
public void setActiveDigitalSignatureType(DigitalSignatureType digitalSignatureType, Auditor auditor) {
|
||||
public void setActiveDigitalSignatureType(DigitalSignatureType digitalSignatureType) {
|
||||
|
||||
digitalSignatureTypeService.setActiveDigitalSignatureType(digitalSignatureType);
|
||||
auditor.audit(AuditCategory.SETTINGS.name(), "Digital signature type has been updated.",
|
||||
@ -54,7 +55,7 @@ public class DigitalSignatureController implements DigitalSignatureResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + WRITE_DIGITAL_SIGNATURE + "')")
|
||||
public DigitalSignatureViewModel saveDigitalSignature(@RequestBody DigitalSignature digitalSignatureModel, Auditor auditor) {
|
||||
public DigitalSignatureViewModel saveDigitalSignature(@RequestBody DigitalSignature digitalSignatureModel) {
|
||||
|
||||
DigitalSignatureViewModel digitalSignatureViewModel = convertToView(digitalSignatureService.saveDigitalSignature(convert(digitalSignatureModel)));
|
||||
auditor.audit(AuditCategory.SETTINGS.name(), "Digital signature has been saved.",
|
||||
@ -66,7 +67,7 @@ public class DigitalSignatureController implements DigitalSignatureResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + WRITE_DIGITAL_SIGNATURE + "')")
|
||||
public void updateDigitalSignature(@RequestBody DigitalSignatureViewModel digitalSignatureModel, Auditor auditor) {
|
||||
public void updateDigitalSignature(@RequestBody DigitalSignatureViewModel digitalSignatureModel) {
|
||||
|
||||
digitalSignatureService.updateDigitalSignature(convert(digitalSignatureModel));
|
||||
auditor.audit(AuditCategory.SETTINGS.name(), "Digital signature has been updated.",
|
||||
@ -84,7 +85,7 @@ public class DigitalSignatureController implements DigitalSignatureResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + WRITE_DIGITAL_SIGNATURE + "')")
|
||||
public void deleteDigitalSignature(Auditor auditor) {
|
||||
public void deleteDigitalSignature() {
|
||||
|
||||
digitalSignatureService.deleteDigitalSignature();
|
||||
auditor.audit(AuditCategory.SETTINGS.name(), "Digital signature has been deleted.",
|
||||
@ -94,7 +95,7 @@ public class DigitalSignatureController implements DigitalSignatureResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + WRITE_DIGITAL_SIGNATURE + "')")
|
||||
public DigitalSignatureKmsViewModel saveDigitalSignatureKms(@RequestBody DigitalSignatureKms digitalSignature, Auditor auditor) {
|
||||
public DigitalSignatureKmsViewModel saveDigitalSignatureKms(@RequestBody DigitalSignatureKms digitalSignature) {
|
||||
|
||||
DigitalSignatureKmsViewModel result = convert(digitalSignatureKmsService.saveDigitalSignature(digitalSignature));
|
||||
auditor.audit(AuditCategory.SETTINGS.name(), "Digital KMS signature has been saved.",
|
||||
@ -113,7 +114,7 @@ public class DigitalSignatureController implements DigitalSignatureResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + WRITE_DIGITAL_SIGNATURE + "')")
|
||||
public void deleteDigitalSignatureKms(Auditor auditor) {
|
||||
public void deleteDigitalSignatureKms() {
|
||||
|
||||
digitalSignatureKmsService.deleteDigitalSignature();
|
||||
auditor.audit(AuditCategory.SETTINGS.name(), "Digital KMS signature has been deleted.",
|
||||
|
||||
@ -28,6 +28,7 @@ import static com.iqser.red.service.persistence.management.v1.processor.roles.Ac
|
||||
@RequiredArgsConstructor
|
||||
public class DossierAttributesController implements DossierAttributesResource {
|
||||
|
||||
private final Auditor auditor;
|
||||
private final DossierAttributeConfigPersistenceService dossierAttributeConfigPersistenceService;
|
||||
private final DossierAttributesManagementService dossierAttributesManagementService;
|
||||
private final AccessControlService accessControlService;
|
||||
@ -35,7 +36,7 @@ public class DossierAttributesController implements DossierAttributesResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + WRITE_DOSSIER_ATTRIBUTES_CONFIG + "')")
|
||||
public DossierAttributesConfig setDossierAttributesConfig(String dossierTemplateId, DossierAttributesConfig dossierAttributesConfig, Auditor auditor) {
|
||||
public DossierAttributesConfig setDossierAttributesConfig(String dossierTemplateId, DossierAttributesConfig dossierAttributesConfig) {
|
||||
|
||||
var result = MagicConverter.convert(dossierAttributeConfigPersistenceService.setDossierAttributesConfig(dossierTemplateId,
|
||||
MagicConverter.convert(dossierAttributesConfig.getDossierAttributeConfigs(), DossierAttributeConfigEntity.class)), DossierAttributeConfig.class);
|
||||
@ -48,8 +49,7 @@ public class DossierAttributesController implements DossierAttributesResource {
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + WRITE_DOSSIER_ATTRIBUTES_CONFIG + "')")
|
||||
public DossierAttributeConfig addOrUpdateDossierAttributeConfig(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId,
|
||||
@RequestBody DossierAttributeConfig dossierAttribute,
|
||||
Auditor auditor) {
|
||||
@RequestBody DossierAttributeConfig dossierAttribute) {
|
||||
|
||||
var result = MagicConverter.convert(dossierAttributeConfigPersistenceService.addOrUpdateDossierAttribute(dossierTemplateId,
|
||||
MagicConverter.convert(dossierAttribute, DossierAttributeConfigEntity.class)), DossierAttributeConfig.class);
|
||||
@ -61,7 +61,7 @@ public class DossierAttributesController implements DossierAttributesResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + WRITE_DOSSIER_ATTRIBUTES_CONFIG + "')")
|
||||
public void deleteDossierAttributeConfig(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @PathVariable(DOSSIER_ATTRIBUTE_ID) String dossierAttributeId, Auditor auditor) {
|
||||
public void deleteDossierAttributeConfig(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @PathVariable(DOSSIER_ATTRIBUTE_ID) String dossierAttributeId) {
|
||||
|
||||
dossierAttributeConfigPersistenceService.deleteDossierAttribute(dossierAttributeId);
|
||||
auditor.audit(AuditCategory.DOSSIER_TEMPLATE.name(), "Dossier attributes removed",
|
||||
@ -71,7 +71,7 @@ public class DossierAttributesController implements DossierAttributesResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + WRITE_DOSSIER_ATTRIBUTES_CONFIG + "')")
|
||||
public void deleteDossierAttributesConfig(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @RequestParam(DOSSIER_ATTRIBUTE_IDS) List<String> dossierAttributeIds, Auditor auditor) {
|
||||
public void deleteDossierAttributesConfig(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @RequestParam(DOSSIER_ATTRIBUTE_IDS) List<String> dossierAttributeIds) {
|
||||
|
||||
dossierAttributeConfigPersistenceService.deleteDossierAttributes(dossierAttributeIds);
|
||||
dossierAttributeIds.forEach(dossierAttributeId -> auditor.audit(AuditCategory.DOSSIER_TEMPLATE.name(), "Dossier attribute removed",
|
||||
@ -89,7 +89,7 @@ public class DossierAttributesController implements DossierAttributesResource {
|
||||
|
||||
|
||||
@PreAuthorize("hasAuthority('" + WRITE_FILE_ATTRIBUTES + "')")
|
||||
public DossierAttributes setDossierAttributes(@PathVariable(DOSSIER_ID) String dossierId, @RequestBody DossierAttributes dossierAttributes, Auditor auditor) {
|
||||
public DossierAttributes setDossierAttributes(@PathVariable(DOSSIER_ID) String dossierId, @RequestBody DossierAttributes dossierAttributes) {
|
||||
|
||||
accessControlService.verifyUserIsDossierOwner(dossierId);
|
||||
var result = dossierAttributesManagementService.setDossierAttributes(dossierId, dossierAttributes.getDossierAttributeList());
|
||||
@ -100,7 +100,7 @@ public class DossierAttributesController implements DossierAttributesResource {
|
||||
|
||||
|
||||
@PreAuthorize("hasAuthority('" + WRITE_DOSSIER_ATTRIBUTES + "')")
|
||||
public DossierAttributes addOrUpdateDossierAttribute(String dossierId, DossierAttribute dossierAttribute, Auditor auditor) {
|
||||
public DossierAttributes addOrUpdateDossierAttribute(String dossierId, DossierAttribute dossierAttribute) {
|
||||
|
||||
accessControlService.verifyUserIsDossierOwner(dossierId);
|
||||
DossierAttribute result = dossierAttributesManagementService.addOrUpdateDossierAttribute(dossierId, dossierAttribute);
|
||||
@ -110,7 +110,7 @@ public class DossierAttributesController implements DossierAttributesResource {
|
||||
|
||||
|
||||
@PreAuthorize("hasAuthority('" + READ_DOSSIER_ATTRIBUTES + "')")
|
||||
public DossierAttributes getDossierAttributes(String dossierId, Auditor auditor) {
|
||||
public DossierAttributes getDossierAttributes(String dossierId) {
|
||||
|
||||
var result = dossierAttributesManagementService.getDossierAttributes(dossierId);
|
||||
auditor.audit(AuditCategory.DOSSIER.name(), "Got dossier attributes.", AuditDetail.DOSSIER_ID, dossierId);
|
||||
@ -120,7 +120,7 @@ public class DossierAttributesController implements DossierAttributesResource {
|
||||
|
||||
|
||||
@PreAuthorize("hasAuthority('" + WRITE_DOSSIER_ATTRIBUTES + "')")
|
||||
public void deleteDossierAttribute(String dossierId, String dossierAttributeId, Auditor auditor) {
|
||||
public void deleteDossierAttribute(String dossierId, String dossierAttributeId) {
|
||||
|
||||
accessControlService.verifyUserIsDossierOwner(dossierId);
|
||||
dossierAttributesManagementService.deleteDossierAttribute(dossierId, dossierAttributeId);
|
||||
|
||||
@ -52,6 +52,7 @@ public class DossierController implements DossierResource {
|
||||
|
||||
private static final Set<String> VALID_MEMBER_ROLES = Set.of(ApplicationRoles.RED_USER_ROLE, ApplicationRoles.RED_MANAGER_ROLE);
|
||||
|
||||
private final Auditor auditor;
|
||||
private final DossierManagementService dossierManagementService;
|
||||
private final UserService userService;
|
||||
private final FileStatusManagementService fileStatusManagementService;
|
||||
@ -82,7 +83,7 @@ public class DossierController implements DossierResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + ADD_UPDATE_DOSSIER + "') && (#dossierRequest.dossierId == null || hasPermission(#dossierRequest.dossierId, 'Dossier', 'ACCESS_OBJECT') )")
|
||||
public ResponseEntity<Dossier> createDossierOrUpdateDossier(@RequestBody DossierRequest dossierRequest, Auditor auditor) {
|
||||
public ResponseEntity<Dossier> createDossierOrUpdateDossier(@RequestBody DossierRequest dossierRequest) {
|
||||
|
||||
if (dossierRequest.getDossierId() != null && dossierRequest.getOwnerId() == null) {
|
||||
throw new BadRequestException("Owner must be set for any update");
|
||||
@ -321,7 +322,7 @@ public class DossierController implements DossierResource {
|
||||
|
||||
|
||||
@PreAuthorize("hasAuthority('" + DELETE_DOSSIER + "') && hasPermission(#dossierId, 'Dossier', 'ACCESS_OBJECT')")
|
||||
public void deleteDossier(@PathVariable(DOSSIER_ID_PARAM) String dossierId, Auditor auditor) {
|
||||
public void deleteDossier(@PathVariable(DOSSIER_ID_PARAM) String dossierId) {
|
||||
|
||||
var dossierToBeDeleted = dossierACLService.enhanceDossierWithACLData(dossierManagementService.getDossierById(dossierId, true, false));
|
||||
|
||||
@ -404,7 +405,7 @@ public class DossierController implements DossierResource {
|
||||
|
||||
@PreAuthorize("hasAuthority('" + ARCHIVE_DOSSIER + "')")
|
||||
@PreFilter("hasPermission(filterObject, 'Dossier', 'ACCESS_OBJECT')")
|
||||
public void archiveDossiers(@RequestBody Set<String> dossierIds, Auditor auditor) {
|
||||
public void archiveDossiers(@RequestBody Set<String> dossierIds) {
|
||||
|
||||
for (String dossierId : dossierIds) {
|
||||
accessControlService.verifyUserIsDossierOwner(dossierId);
|
||||
@ -418,7 +419,7 @@ public class DossierController implements DossierResource {
|
||||
|
||||
|
||||
@PreAuthorize("hasAuthority('" + UNARCHIVE_DOSSIER + "')")
|
||||
public void unarchiveDossiers(@RequestBody Set<String> dossierIds, Auditor auditor) {
|
||||
public void unarchiveDossiers(@RequestBody Set<String> dossierIds) {
|
||||
|
||||
dossierManagementService.unarchiveDossiers(dossierIds);
|
||||
|
||||
@ -430,7 +431,7 @@ public class DossierController implements DossierResource {
|
||||
|
||||
@PreAuthorize("hasAuthority('" + DELETE_DOSSIER + "')")
|
||||
@PreFilter("hasPermission(filterObject, 'Dossier', 'ACCESS_OBJECT')")
|
||||
public void hardDeleteDossiers(@RequestParam(DOSSIER_ID_PARAM) Set<String> dossierIds, Auditor auditor) {
|
||||
public void hardDeleteDossiers(@RequestParam(DOSSIER_ID_PARAM) Set<String> dossierIds) {
|
||||
|
||||
for (String dossierId : dossierIds) {
|
||||
accessControlService.verifyUserIsDossierOwner(dossierId);
|
||||
@ -445,7 +446,7 @@ public class DossierController implements DossierResource {
|
||||
|
||||
@PreAuthorize("hasAuthority('" + DELETE_DOSSIER + "')")
|
||||
@PreFilter("hasPermission(filterObject, 'Dossier', 'ACCESS_OBJECT')")
|
||||
public void undeleteDossiers(@RequestBody Set<String> dossierIds, Auditor auditor) {
|
||||
public void undeleteDossiers(@RequestBody Set<String> dossierIds) {
|
||||
|
||||
dossierManagementService.undeleteDossiers(dossierIds);
|
||||
for (String dossierId : dossierIds) {
|
||||
|
||||
@ -6,7 +6,6 @@ import com.iqser.red.service.persistence.management.v1.processor.exception.Confl
|
||||
import com.iqser.red.service.persistence.management.v1.processor.service.DossierManagementService;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.service.DossierTemplateManagementService;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.service.DossierTemplateStatsService;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.service.users.UserService;
|
||||
import com.iqser.red.service.persistence.service.v1.api.external.resource.DossierTemplateResource;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.audit.AuditCategory;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.DossierTemplateModel;
|
||||
@ -44,16 +43,16 @@ import static com.iqser.red.service.persistence.management.v1.processor.service.
|
||||
@RequiredArgsConstructor
|
||||
public class DossierTemplateController implements DossierTemplateResource {
|
||||
|
||||
private final Auditor auditor;
|
||||
private final DossierTemplateManagementService dossierTemplateManagementService;
|
||||
private final DossierTemplateStatsService dossierTemplateStatsService;
|
||||
private final DossierManagementService dossierManagementService;
|
||||
private final DossierACLService dossierACLService;
|
||||
private final UserService userService;
|
||||
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + WRITE_DOSSIER_TEMPLATES + "')")
|
||||
public DossierTemplateModel createOrUpdateDossierTemplate(@RequestBody DossierTemplateModel dossierTemplateModel, Auditor auditor) {
|
||||
public DossierTemplateModel createOrUpdateDossierTemplate(@RequestBody DossierTemplateModel dossierTemplateModel) {
|
||||
|
||||
String userId = KeycloakSecurity.getUserId();
|
||||
dossierTemplateModel.setCreatedBy(userId);
|
||||
@ -94,7 +93,7 @@ public class DossierTemplateController implements DossierTemplateResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + WRITE_DOSSIER_TEMPLATES + "')")
|
||||
public void deleteDossierTemplate(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, Auditor auditor) {
|
||||
public void deleteDossierTemplate(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId) {
|
||||
|
||||
String userId = KeycloakSecurity.getUserId();
|
||||
|
||||
@ -111,7 +110,7 @@ public class DossierTemplateController implements DossierTemplateResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + READ_DOSSIER_TEMPLATES + "')")
|
||||
public void deleteDossierTemplates(@RequestBody List<String> dossierTemplateIds, Auditor auditor) {
|
||||
public void deleteDossierTemplates(@RequestBody List<String> dossierTemplateIds) {
|
||||
|
||||
String userId = KeycloakSecurity.getUserId();
|
||||
List<String> errorIds = new ArrayList<>();
|
||||
@ -140,8 +139,7 @@ public class DossierTemplateController implements DossierTemplateResource {
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + WRITE_DOSSIER_TEMPLATES + "')")
|
||||
public DossierTemplateModel cloneDossierTemplate(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId,
|
||||
@RequestBody CloneDossierTemplateRequest cloneDossierTemplateRequest,
|
||||
Auditor auditor) {
|
||||
@RequestBody CloneDossierTemplateRequest cloneDossierTemplateRequest) {
|
||||
|
||||
try {
|
||||
|
||||
@ -185,7 +183,7 @@ public class DossierTemplateController implements DossierTemplateResource {
|
||||
|
||||
|
||||
@PreAuthorize("hasAuthority('" + READ_DOSSIER_TEMPLATES + "')")
|
||||
public DownloadResponse prepareExportDownload(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, Auditor auditor) {
|
||||
public DownloadResponse prepareExportDownload(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId) {
|
||||
|
||||
try {
|
||||
ExportDownloadRequest request = ExportDownloadRequest.builder().dossierTemplateId(dossierTemplateId).userId(KeycloakSecurity.getUserId()).build();
|
||||
@ -204,8 +202,7 @@ public class DossierTemplateController implements DossierTemplateResource {
|
||||
@PreAuthorize("hasAuthority('" + WRITE_DOSSIER_TEMPLATES + "')")
|
||||
public DossierTemplateModel importDossierTemplate(@RequestPart(name = "file") MultipartFile file,
|
||||
@RequestParam(value = DOSSIER_TEMPLATE_ID, required = false) String dossierTemplateId,
|
||||
@RequestParam(value = "updateExistingDossierTemplate", required = false, defaultValue = "false") boolean updateExistingDossierTemplate,
|
||||
Auditor auditor) {
|
||||
@RequestParam(value = "updateExistingDossierTemplate", required = false, defaultValue = "false") boolean updateExistingDossierTemplate) {
|
||||
|
||||
String originalFileName = file.getOriginalFilename();
|
||||
if (originalFileName == null || originalFileName.isEmpty()) {
|
||||
|
||||
@ -52,6 +52,7 @@ public class DownloadController implements DownloadResource {
|
||||
|
||||
private static final Pattern COLOR_PATTERN = Pattern.compile("^#[\\da-f]{6,6}$");
|
||||
|
||||
private final Auditor auditor;
|
||||
private final DossierManagementService dossierService;
|
||||
private final FileStatusService fileStatusService;
|
||||
private final DownloadService downloadService;
|
||||
@ -67,7 +68,7 @@ public class DownloadController implements DownloadResource {
|
||||
|
||||
|
||||
@PreAuthorize("hasAuthority('" + PROCESS_DOWNLOAD + "')")
|
||||
public DownloadResponse prepareDownload(@RequestBody PrepareDownloadRequest request, Auditor auditor) {
|
||||
public DownloadResponse prepareDownload(@RequestBody PrepareDownloadRequest request) {
|
||||
|
||||
// check the user is non-member or reviewer
|
||||
accessControlService.verifyUserIsDossierOwnerOrApprover(request.getDossierId());
|
||||
@ -79,7 +80,7 @@ public class DownloadController implements DownloadResource {
|
||||
|
||||
|
||||
@PreAuthorize("hasAuthority('" + PROCESS_DOWNLOAD + "')")
|
||||
public DownloadResponse prepareDownload(@RequestBody PrepareDownloadWithOptionRequest request, Auditor auditor) {
|
||||
public DownloadResponse prepareDownload(@RequestBody PrepareDownloadWithOptionRequest request) {
|
||||
|
||||
validateDossierId(request.getDossierId());
|
||||
|
||||
@ -153,7 +154,7 @@ public class DownloadController implements DownloadResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + PROCESS_DOWNLOAD + "')")
|
||||
public void deleteDownloadStatus(@RequestBody RemoveDownloadRequest removeDownloadRequest, Auditor auditor) {
|
||||
public void deleteDownloadStatus(@RequestBody RemoveDownloadRequest removeDownloadRequest) {
|
||||
|
||||
removeDownloadRequest.getStorageIds().forEach(storageId -> {
|
||||
downloadService.deleteDownloadStatus(JSONPrimitive.of(storageId));
|
||||
@ -186,8 +187,7 @@ public class DownloadController implements DownloadResource {
|
||||
|
||||
@PreAuthorize("hasAuthority('" + PROCESS_DOWNLOAD + "')")
|
||||
public CompletableFuture<ResponseEntity<InputStreamResource>> downloadFile(@RequestParam(STORAGE_ID) String storageId,
|
||||
@RequestParam(value = "inline", required = false, defaultValue = FALSE) boolean inline,
|
||||
Auditor auditor) {
|
||||
@RequestParam(value = "inline", required = false, defaultValue = FALSE) boolean inline) {
|
||||
var userId = KeycloakSecurity.getUserId();
|
||||
var tenantId = TenantContext.getTenantId();
|
||||
|
||||
@ -195,7 +195,7 @@ public class DownloadController implements DownloadResource {
|
||||
|
||||
TenantContext.setTenantId(tenantId);
|
||||
var downloadStatus = getDownloadStatus(storageId, userId);
|
||||
var fileDownloadStream = getFileForDownload(storageId, auditor);
|
||||
var fileDownloadStream = getFileForDownload(storageId);
|
||||
|
||||
return getResponseEntity(inline, fileDownloadStream, downloadStatus.getFilename(), MediaType.parseMediaType("application/zip"), downloadStatus.getFileSize());
|
||||
});
|
||||
@ -211,7 +211,7 @@ public class DownloadController implements DownloadResource {
|
||||
}
|
||||
|
||||
|
||||
private InputStreamResource getFileForDownload(String storageId, Auditor auditor) {
|
||||
private InputStreamResource getFileForDownload(String storageId) {
|
||||
|
||||
try {
|
||||
var response = storageService.getObject(TenantContext.getTenantId(), storageId);
|
||||
@ -252,14 +252,14 @@ public class DownloadController implements DownloadResource {
|
||||
@Override
|
||||
public CompletableFuture<ResponseEntity<InputStreamResource>> downloadFileUsingOTT(@PathVariable(OTT) String oneTimeToken,
|
||||
@RequestParam(value = "inline", required = false, defaultValue = FALSE) boolean inline,
|
||||
@RequestParam(value = "tenantId") String tenantId, Auditor auditor) {
|
||||
@RequestParam(value = "tenantId") String tenantId) {
|
||||
return CompletableFuture.supplyAsync(() -> {
|
||||
TenantContext.setTenantId(tenantId);
|
||||
|
||||
log.debug("downloadFileUsingOTT {}", oneTimeToken);
|
||||
var token = oneTimeTokenDownloadService.getToken(oneTimeToken);
|
||||
var downloadStatus = getDownloadStatus(token.getStorageId(), token.getUserId());
|
||||
var fileDownloadStream = getFileForDownload(token.getStorageId(), auditor);
|
||||
var fileDownloadStream = getFileForDownload(token.getStorageId());
|
||||
|
||||
TenantContext.clear();
|
||||
|
||||
|
||||
@ -35,6 +35,7 @@ import static com.iqser.red.service.persistence.management.v1.processor.roles.Ac
|
||||
@RequiredArgsConstructor
|
||||
public class FileAttributesController implements FileAttributesResource {
|
||||
|
||||
private final Auditor auditor;
|
||||
private final FileAttributesManagementService fileAttributesManagementService;
|
||||
private final FileAttributeConfigPersistenceService fileAttributeConfigPersistenceService;
|
||||
private final FileStatusService fileStatusService;
|
||||
@ -43,7 +44,7 @@ public class FileAttributesController implements FileAttributesResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + WRITE_FILE_ATTRIBUTES_CONFIG + "')")
|
||||
public FileAttributesConfig setFileAttributesConfig(String dossierTemplateId, FileAttributesConfig fileAttributesConfig, Auditor auditor) {
|
||||
public FileAttributesConfig setFileAttributesConfig(String dossierTemplateId, FileAttributesConfig fileAttributesConfig) {
|
||||
|
||||
if (StringUtils.isEmpty(fileAttributesConfig.getEncoding()) || !encodingList.contains(fileAttributesConfig.getEncoding().trim())) {
|
||||
throw new BadRequestException("Invalid encoding setting");
|
||||
@ -66,7 +67,7 @@ public class FileAttributesController implements FileAttributesResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + WRITE_FILE_ATTRIBUTES_CONFIG + "')")
|
||||
public FileAttributeConfig addOrUpdateFileAttribute(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @RequestBody FileAttributeConfig fileAttribute, Auditor auditor) {
|
||||
public FileAttributeConfig addOrUpdateFileAttribute(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @RequestBody FileAttributeConfig fileAttribute) {
|
||||
|
||||
var result = fileAttributeConfigPersistenceService.addOrUpdateFileAttribute(dossierTemplateId, MagicConverter.convert(fileAttribute, FileAttributeConfigEntity.class));
|
||||
auditor.audit(AuditCategory.DOSSIER_TEMPLATE.name(), "File attributes added/updated",
|
||||
@ -79,7 +80,7 @@ public class FileAttributesController implements FileAttributesResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + WRITE_FILE_ATTRIBUTES_CONFIG + "')")
|
||||
public void deleteFileAttribute(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @PathVariable(FILE_ATTRIBUTE_ID) String fileAttributeId, Auditor auditor) {
|
||||
public void deleteFileAttribute(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @PathVariable(FILE_ATTRIBUTE_ID) String fileAttributeId) {
|
||||
|
||||
fileAttributeConfigPersistenceService.deleteFileAttribute(fileAttributeId);
|
||||
auditor.audit(AuditCategory.DOSSIER_TEMPLATE.name(), "File attributes removed",
|
||||
@ -89,7 +90,7 @@ public class FileAttributesController implements FileAttributesResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + WRITE_FILE_ATTRIBUTES_CONFIG + "')")
|
||||
public void deleteFileAttributes(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @RequestBody List<String> fileAttributeIds, Auditor auditor) {
|
||||
public void deleteFileAttributes(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @RequestBody List<String> fileAttributeIds) {
|
||||
|
||||
fileAttributeConfigPersistenceService.deleteFileAttributes(fileAttributeIds);
|
||||
fileAttributeIds.forEach(fileAttributeId -> auditor.audit(AuditCategory.DOSSIER_TEMPLATE.name(), "File attribute removed",
|
||||
@ -118,7 +119,7 @@ public class FileAttributesController implements FileAttributesResource {
|
||||
|
||||
|
||||
@PreAuthorize("hasAuthority('" + WRITE_FILE_ATTRIBUTES + "')")
|
||||
public void setFileAttributes(@PathVariable(DOSSIER_ID_PARAM) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody FileAttributes fileAttributes, Auditor auditor) {
|
||||
public void setFileAttributes(@PathVariable(DOSSIER_ID_PARAM) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody FileAttributes fileAttributes) {
|
||||
|
||||
var file = fileStatusService.getStatus(fileId);
|
||||
|
||||
|
||||
@ -52,6 +52,7 @@ public class FileManagementController implements FileManagementResource {
|
||||
|
||||
private static final String DOWNLOAD_HEADER_NAME = "Content-Disposition";
|
||||
|
||||
private final Auditor auditor;
|
||||
private final FileService fileService;
|
||||
private final AccessControlService accessControlService;
|
||||
private final PDFTronClient pdfTronClient;
|
||||
@ -65,7 +66,7 @@ public class FileManagementController implements FileManagementResource {
|
||||
@Timed
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + DELETE_FILE + "')")
|
||||
public void deleteFile(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, Auditor auditor) {
|
||||
public void deleteFile(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId) {
|
||||
|
||||
fileService.deleteFile(dossierId, fileId);
|
||||
auditor.audit(AuditCategory.DOSSIER.name(), "File has been deleted.",
|
||||
@ -76,7 +77,7 @@ public class FileManagementController implements FileManagementResource {
|
||||
@Timed
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + DELETE_FILE + "')")
|
||||
public void deleteFiles(@PathVariable(DOSSIER_ID) String dossierId, @RequestBody List<String> fileIds, Auditor auditor) {
|
||||
public void deleteFiles(@PathVariable(DOSSIER_ID) String dossierId, @RequestBody List<String> fileIds) {
|
||||
|
||||
List<String> errorIds = new ArrayList<>();
|
||||
for (String fileId : fileIds) {
|
||||
@ -154,7 +155,7 @@ public class FileManagementController implements FileManagementResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + DELETE_FILE + "')")
|
||||
public void hardDeleteFiles(@PathVariable(DOSSIER_ID) String dossierId, @RequestParam(FILE_IDS) Set<String> fileIds, Auditor auditor) {
|
||||
public void hardDeleteFiles(@PathVariable(DOSSIER_ID) String dossierId, @RequestParam(FILE_IDS) Set<String> fileIds) {
|
||||
|
||||
for (String fileId : fileIds) {
|
||||
if (fileStatusManagementService.getFileStatus(fileId).getAssignee() != null) {
|
||||
@ -169,7 +170,7 @@ public class FileManagementController implements FileManagementResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + DELETE_FILE + "')")
|
||||
public void restoreFiles(@PathVariable(DOSSIER_ID) String dossierId, @RequestBody Set<String> fileIds, Auditor auditor) {
|
||||
public void restoreFiles(@PathVariable(DOSSIER_ID) String dossierId, @RequestBody Set<String> fileIds) {
|
||||
|
||||
verifyUserIsDossierOwnerOrApproverOrAssignedReviewer(dossierId, fileIds);
|
||||
fileService.undeleteFiles(dossierId, fileIds);
|
||||
@ -180,7 +181,7 @@ public class FileManagementController implements FileManagementResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + ROTATE_PAGE + "')")
|
||||
public void rotatePages(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody RotatePagesRequest rotatePagesRequest, Auditor auditor) {
|
||||
public void rotatePages(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody RotatePagesRequest rotatePagesRequest) {
|
||||
|
||||
accessControlService.verifyFileIsNotApproved(dossierId, fileId);
|
||||
accessControlService.verifyUserIsReviewer(dossierId, fileId);
|
||||
|
||||
@ -23,11 +23,12 @@ import static com.iqser.red.service.persistence.management.v1.processor.roles.Ac
|
||||
@RequiredArgsConstructor
|
||||
public class LegalBasisMappingController implements LegalBasisMappingResource {
|
||||
|
||||
private final Auditor auditor;
|
||||
private final LegalBasisMappingPersistenceService legalBasisMappingPersistenceService;
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + WRITE_LEGAL_BASIS + "')")
|
||||
public void deleteLegalBasis(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, @RequestBody List<String> legalBasisNames, Auditor auditor) {
|
||||
public void deleteLegalBasis(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, @RequestBody List<String> legalBasisNames) {
|
||||
|
||||
legalBasisMappingPersistenceService.deleteLegalBasis(dossierTemplateId, legalBasisNames);
|
||||
auditor.audit(AuditCategory.DOSSIER_TEMPLATE.name(), "Legal basis mapping has been changed.",
|
||||
@ -37,7 +38,7 @@ public class LegalBasisMappingController implements LegalBasisMappingResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + WRITE_LEGAL_BASIS + "')")
|
||||
public void addOrUpdateLegalBasis(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, @RequestBody LegalBasis legalBasis, Auditor auditor) {
|
||||
public void addOrUpdateLegalBasis(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, @RequestBody LegalBasis legalBasis) {
|
||||
|
||||
legalBasisMappingPersistenceService.addOrUpdateLegalBasis(dossierTemplateId, legalBasis);
|
||||
auditor.audit(AuditCategory.DOSSIER_TEMPLATE.name(), "Legal basis mapping has been changed.",
|
||||
@ -46,7 +47,7 @@ public class LegalBasisMappingController implements LegalBasisMappingResource {
|
||||
|
||||
|
||||
@PreAuthorize("hasAuthority('" + WRITE_LEGAL_BASIS + "')")
|
||||
public void setLegalBasisMapping(@RequestBody List<LegalBasis> legalBasisMapping, @PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, Auditor auditor) {
|
||||
public void setLegalBasisMapping(@RequestBody List<LegalBasis> legalBasisMapping, @PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId) {
|
||||
|
||||
legalBasisMappingPersistenceService.setLegalBasisMapping(dossierTemplateId, legalBasisMapping);
|
||||
auditor.audit(AuditCategory.DOSSIER_TEMPLATE.name(), "Legal basis mapping has been changed.",
|
||||
|
||||
@ -19,12 +19,14 @@ import static com.iqser.red.service.persistence.management.v1.processor.roles.Ac
|
||||
public class LicenseReportController implements LicenseReportResource {
|
||||
|
||||
private static final String LICENSE_AUDIT_KEY = "License";
|
||||
|
||||
private final Auditor auditor;
|
||||
private final LicenseReportService licenseReportService;
|
||||
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + READ_LICENSE_REPORT + "')")
|
||||
public LicenseReport getReport(@RequestBody LicenseReportRequest reportRequest, Auditor auditor) {
|
||||
public LicenseReport getReport(@RequestBody LicenseReportRequest reportRequest) {
|
||||
|
||||
LicenseReport licenseReport = licenseReportService.getLicenseReport(reportRequest);
|
||||
auditor.audit(AuditCategory.LICENSE.name(), "License report has been viewed.", AuditDetail.OBJECT_ID, LICENSE_AUDIT_KEY);
|
||||
|
||||
@ -35,6 +35,7 @@ import static com.knecon.fforesight.auditor.model.Detail.d;
|
||||
@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE)
|
||||
public class ManualRedactionController implements ManualRedactionResource {
|
||||
|
||||
Auditor auditor;
|
||||
ManualRedactionService manualRedactionService;
|
||||
ManualRedactionUndoService manualRedactionUndoService;
|
||||
DossierManagementService dossierManagementService;
|
||||
@ -59,8 +60,7 @@ public class ManualRedactionController implements ManualRedactionResource {
|
||||
public void undoComment(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@PathVariable(ANNOTATION_ID) String annotationId,
|
||||
@PathVariable(COMMENT_ID) String commentId,
|
||||
Auditor auditor) {
|
||||
@PathVariable(COMMENT_ID) String commentId) {
|
||||
|
||||
accessControlService.verifyFileIsNotApproved(dossierId, fileId);
|
||||
accessControlService.verifyUserIsReviewerOrApprover(dossierId, fileId);
|
||||
@ -93,8 +93,7 @@ public class ManualRedactionController implements ManualRedactionResource {
|
||||
public CommentResponse addComment(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@PathVariable(ANNOTATION_ID) String annotationId,
|
||||
@RequestBody AddCommentRequestModel addCommentRequest,
|
||||
Auditor auditor) {
|
||||
@RequestBody AddCommentRequestModel addCommentRequest) {
|
||||
|
||||
accessControlService.verifyFileIsNotApproved(dossierId, fileId);
|
||||
accessControlService.verifyUserIsReviewerOrApprover(dossierId, fileId);
|
||||
@ -115,8 +114,7 @@ public class ManualRedactionController implements ManualRedactionResource {
|
||||
@PreAuthorize("hasAuthority('" + DO_MANUAL_REDACTION + "')")
|
||||
public List<ManualAddResponse> addRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestBody Set<AddRedactionRequestModel> addRedactionRequests,
|
||||
Auditor auditor) {
|
||||
@RequestBody Set<AddRedactionRequestModel> addRedactionRequests) {
|
||||
|
||||
var dossier = dossierManagementService.getDossierById(dossierId, false, false);
|
||||
|
||||
@ -140,8 +138,7 @@ public class ManualRedactionController implements ManualRedactionResource {
|
||||
@PreAuthorize("hasAuthority('" + DO_MANUAL_REDACTION + "')")
|
||||
public List<ManualAddResponse> removeRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestBody Set<RemoveRedactionRequestModel> removeRedactionRequests,
|
||||
Auditor auditor) {
|
||||
@RequestBody Set<RemoveRedactionRequestModel> removeRedactionRequests) {
|
||||
|
||||
var dossier = dossierManagementService.getDossierById(dossierId, false, false);
|
||||
accessControlService.verifyFileIsNotApproved(dossierId, fileId);
|
||||
@ -164,8 +161,7 @@ public class ManualRedactionController implements ManualRedactionResource {
|
||||
@PreAuthorize("hasAuthority('" + DO_MANUAL_REDACTION + "')")
|
||||
public List<ManualAddResponse> forceRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestBody Set<ForceRedactionRequestModel> forceRedactionRequests,
|
||||
Auditor auditor) {
|
||||
@RequestBody Set<ForceRedactionRequestModel> forceRedactionRequests) {
|
||||
|
||||
accessControlService.verifyFileIsNotApproved(dossierId, fileId);
|
||||
accessControlService.verifyUserIsMemberOrApprover(dossierId);
|
||||
@ -183,8 +179,7 @@ public class ManualRedactionController implements ManualRedactionResource {
|
||||
@PreAuthorize("hasAuthority('" + DO_MANUAL_REDACTION + "')")
|
||||
public List<ManualAddResponse> legalBasisChangeBulk(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestBody Set<LegalBasisChangeRequestModel> legalBasisChangeRequests,
|
||||
Auditor auditor) {
|
||||
@RequestBody Set<LegalBasisChangeRequestModel> legalBasisChangeRequests) {
|
||||
|
||||
accessControlService.verifyFileIsNotApproved(dossierId, fileId);
|
||||
accessControlService.verifyUserIsMemberOrApprover(dossierId);
|
||||
@ -203,8 +198,7 @@ public class ManualRedactionController implements ManualRedactionResource {
|
||||
@PreAuthorize("hasAuthority('" + DO_MANUAL_REDACTION + "')")
|
||||
public List<ManualAddResponse> recategorizeBulk(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestBody Set<RecategorizationRequestModel> recategorizationRequests,
|
||||
Auditor auditor) {
|
||||
@RequestBody Set<RecategorizationRequestModel> recategorizationRequests) {
|
||||
|
||||
var dossier = dossierManagementService.getDossierById(dossierId, false, false);
|
||||
accessControlService.verifyFileIsNotApproved(dossierId, fileId);
|
||||
@ -224,8 +218,7 @@ public class ManualRedactionController implements ManualRedactionResource {
|
||||
@PreAuthorize("hasAuthority('" + DO_MANUAL_REDACTION + "')")
|
||||
public List<ManualAddResponse> resizeRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestBody Set<ResizeRedactionRequestModel> resizeRedactionRequests,
|
||||
Auditor auditor) {
|
||||
@RequestBody Set<ResizeRedactionRequestModel> resizeRedactionRequests) {
|
||||
|
||||
accessControlService.verifyFileIsNotApproved(dossierId, fileId);
|
||||
accessControlService.verifyUserIsMemberOrApprover(dossierId);
|
||||
|
||||
@ -28,6 +28,7 @@ import static com.knecon.fforesight.auditor.model.Detail.d;
|
||||
@RequiredArgsConstructor
|
||||
public class RSSController implements RSSResource {
|
||||
|
||||
private final Auditor auditor;
|
||||
private final RssReportClient rssReportClient;
|
||||
private final ComponentOverrideService componentOverrideService;
|
||||
|
||||
@ -62,7 +63,7 @@ public class RSSController implements RSSResource {
|
||||
|
||||
|
||||
@PreAuthorize("hasAuthority('" + GET_RSS + "')")
|
||||
public void addOverrides(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody ComponentsOverrides componentsOverrides, Auditor auditor) {
|
||||
public void addOverrides(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody ComponentsOverrides componentsOverrides) {
|
||||
|
||||
componentOverrideService.addOverrides(dossierId, fileId, componentsOverrides);
|
||||
|
||||
@ -85,8 +86,7 @@ public class RSSController implements RSSResource {
|
||||
@PreAuthorize("hasAuthority('" + GET_RSS + "')")
|
||||
public void revertOverrides(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestBody RevertOverrideRequest revertOverrideRequest,
|
||||
Auditor auditor) {
|
||||
@RequestBody RevertOverrideRequest revertOverrideRequest) {
|
||||
|
||||
var rssReport = rssReportClient.getDetailedRSS(dossierId, fileId);
|
||||
var components = rssReport.getFiles().get(0).getResult();
|
||||
|
||||
@ -32,12 +32,13 @@ import static com.iqser.red.service.persistence.management.v1.processor.roles.Ac
|
||||
@RequiredArgsConstructor
|
||||
public class ReanalysisController implements ReanalysisResource {
|
||||
|
||||
private final Auditor auditor;
|
||||
private final ReanalysisService reanalysisService;
|
||||
private final FileStatusManagementService fileStatusManagementService;
|
||||
private final AccessControlService accessControlService;
|
||||
|
||||
@PreAuthorize("hasAuthority('" + REANALYZE_DOSSIER + "')")
|
||||
public void reanalyzeDossier(@PathVariable(DOSSIER_ID) String dossierId, @RequestParam(value = FORCE_PARAM, required = false, defaultValue = FALSE) boolean force, Auditor auditor) {
|
||||
public void reanalyzeDossier(@PathVariable(DOSSIER_ID) String dossierId, @RequestParam(value = FORCE_PARAM, required = false, defaultValue = FALSE) boolean force) {
|
||||
|
||||
try {
|
||||
accessControlService.verifyUserHasViewPermissions(dossierId);
|
||||
@ -55,8 +56,7 @@ public class ReanalysisController implements ReanalysisResource {
|
||||
@PreAuthorize("hasAuthority('" + REANALYZE_FILE + "')")
|
||||
public void reanalyzeFile(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestParam(value = FORCE_PARAM, required = false, defaultValue = FALSE) boolean force,
|
||||
Auditor auditor) {
|
||||
@RequestParam(value = FORCE_PARAM, required = false, defaultValue = FALSE) boolean force) {
|
||||
|
||||
reanalysisService.reanalyzeFiles(dossierId, Sets.newHashSet(fileId), force);
|
||||
auditor.audit(AuditCategory.DOSSIER.name(), "Reanalyse file was triggered", AuditDetail.DOSSIER_ID, dossierId);
|
||||
@ -67,8 +67,7 @@ public class ReanalysisController implements ReanalysisResource {
|
||||
@PreAuthorize("hasAuthority('" + REANALYZE_FILE + "')")
|
||||
public void reanalyzeFilesForDossier(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@RequestBody List<String> fileIds,
|
||||
@RequestParam(value = FORCE_PARAM, required = false, defaultValue = FALSE) boolean force,
|
||||
Auditor auditor) {
|
||||
@RequestParam(value = FORCE_PARAM, required = false, defaultValue = FALSE) boolean force) {
|
||||
|
||||
reanalysisService.reanalyzeFiles(dossierId, new HashSet<>(fileIds), force);
|
||||
|
||||
@ -80,7 +79,7 @@ public class ReanalysisController implements ReanalysisResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + REANALYZE_DOSSIER + "')")
|
||||
public void ocrDossier(@PathVariable(DOSSIER_ID) String dossierId, Auditor auditor) {
|
||||
public void ocrDossier(@PathVariable(DOSSIER_ID) String dossierId) {
|
||||
|
||||
try {
|
||||
accessControlService.verifyUserHasViewPermissions(dossierId);
|
||||
@ -100,7 +99,7 @@ public class ReanalysisController implements ReanalysisResource {
|
||||
@PreAuthorize("hasAuthority('" + REANALYZE_FILE + "')")
|
||||
public void ocrFile(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestParam(value = FORCE_PARAM, required = false, defaultValue = FALSE) boolean force, Auditor auditor) {
|
||||
@RequestParam(value = FORCE_PARAM, required = false, defaultValue = FALSE) boolean force) {
|
||||
|
||||
validateOCR(dossierId, fileId);
|
||||
reanalysisService.ocrFile(dossierId, fileId, force);
|
||||
@ -111,7 +110,7 @@ public class ReanalysisController implements ReanalysisResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + REANALYZE_FILE + "')")
|
||||
public void ocrFiles(@PathVariable(DOSSIER_ID) String dossierId, @RequestBody Set<String> fileIds, Auditor auditor) {
|
||||
public void ocrFiles(@PathVariable(DOSSIER_ID) String dossierId, @RequestBody Set<String> fileIds) {
|
||||
|
||||
fileIds.forEach(fileId -> validateOCR(dossierId, fileId));
|
||||
reanalysisService.ocrFiles(dossierId, fileIds);
|
||||
@ -122,8 +121,7 @@ public class ReanalysisController implements ReanalysisResource {
|
||||
@PreAuthorize("hasAuthority('" + EXCLUDE_INCLUDE_FILE + "')")
|
||||
public void toggleAutomaticAnalysis(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestParam(EXCLUDED_STATUS_PARAM) boolean excludedFromAutomaticAnalysis,
|
||||
Auditor auditor) {
|
||||
@RequestParam(EXCLUDED_STATUS_PARAM) boolean excludedFromAutomaticAnalysis) {
|
||||
|
||||
accessControlService.verifyUserIsReviewer(dossierId, fileId);
|
||||
fileStatusManagementService.toggleAutomaticAnalysis(dossierId, fileId, excludedFromAutomaticAnalysis);
|
||||
@ -139,8 +137,7 @@ public class ReanalysisController implements ReanalysisResource {
|
||||
@PreAuthorize("hasAuthority('" + EXCLUDE_INCLUDE_FILE + "')")
|
||||
public void toggleExclusion(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestParam(name = EXCLUDED_STATUS_PARAM, required = false, defaultValue = "false") boolean excluded,
|
||||
Auditor auditor) {
|
||||
@RequestParam(name = EXCLUDED_STATUS_PARAM, required = false, defaultValue = "false") boolean excluded) {
|
||||
|
||||
var status = fileStatusManagementService.getFileStatus(fileId);
|
||||
if (!(status.getAssignee() == null && status.isExcluded())) { // Needed to include documents after 3.0 migration.
|
||||
@ -156,13 +153,12 @@ public class ReanalysisController implements ReanalysisResource {
|
||||
@PreAuthorize("hasAuthority('" + EXCLUDE_INCLUDE_FILE + "')")
|
||||
public void toggleAutomaticAnalysisForList(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@RequestBody Set<String> fileIds,
|
||||
@RequestParam(EXCLUDED_STATUS_PARAM) boolean excludedFromAutomaticAnalysis,
|
||||
Auditor auditor) {
|
||||
@RequestParam(EXCLUDED_STATUS_PARAM) boolean excludedFromAutomaticAnalysis) {
|
||||
|
||||
List<String> errorIds = new ArrayList<>();
|
||||
for (var fileId : fileIds) {
|
||||
try {
|
||||
this.toggleAutomaticAnalysis(dossierId, fileId, excludedFromAutomaticAnalysis, auditor);
|
||||
this.toggleAutomaticAnalysis(dossierId, fileId, excludedFromAutomaticAnalysis);
|
||||
} catch (FeignException e) {
|
||||
errorIds.add(fileId);
|
||||
}
|
||||
@ -175,13 +171,12 @@ public class ReanalysisController implements ReanalysisResource {
|
||||
@PreAuthorize("hasAuthority('" + EXCLUDE_INCLUDE_FILE + "')")
|
||||
public void toggleExclusionForList(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@RequestBody Set<String> fileIds,
|
||||
@RequestParam(name = EXCLUDED_STATUS_PARAM, required = false, defaultValue = "false") boolean excluded,
|
||||
Auditor auditor) {
|
||||
@RequestParam(name = EXCLUDED_STATUS_PARAM, required = false, defaultValue = "false") boolean excluded) {
|
||||
|
||||
List<String> errorIds = new ArrayList<>();
|
||||
for (var fileId : fileIds) {
|
||||
try {
|
||||
this.toggleExclusion(dossierId, fileId, excluded, auditor);
|
||||
this.toggleExclusion(dossierId, fileId, excluded);
|
||||
} catch (FeignException e) {
|
||||
errorIds.add(fileId);
|
||||
}
|
||||
@ -196,8 +191,7 @@ public class ReanalysisController implements ReanalysisResource {
|
||||
@PreAuthorize("hasAuthority('" + EXCLUDE_INCLUDE_PAGES + "')")
|
||||
public void excludePages(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestBody PageExclusionRequest pageExclusionRequest,
|
||||
Auditor auditor) {
|
||||
@RequestBody PageExclusionRequest pageExclusionRequest) {
|
||||
|
||||
accessControlService.verifyUserIsReviewerOrApprover(dossierId, fileId);
|
||||
|
||||
@ -216,7 +210,7 @@ public class ReanalysisController implements ReanalysisResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + EXCLUDE_INCLUDE_PAGES + "')")
|
||||
public void includePages(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody PageExclusionRequest pageInclusionRequest, Auditor auditor) {
|
||||
public void includePages(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody PageExclusionRequest pageInclusionRequest) {
|
||||
|
||||
accessControlService.verifyUserIsReviewerOrApprover(dossierId, fileId);
|
||||
|
||||
@ -235,8 +229,7 @@ public class ReanalysisController implements ReanalysisResource {
|
||||
@PreAuthorize("hasAuthority('" + REINDEX + "')")
|
||||
public void reindex(@RequestParam(value = "dossierId", required = false) String dossierId,
|
||||
@RequestParam(value = "dropIndex", required = false, defaultValue = FALSE) boolean dropIndex,
|
||||
@RequestBody List<String> fileIds,
|
||||
Auditor auditor) {
|
||||
@RequestBody List<String> fileIds) {
|
||||
|
||||
reanalysisService.reindex(dossierId, dropIndex, new HashSet<>(fileIds));
|
||||
|
||||
|
||||
@ -50,6 +50,7 @@ import static com.iqser.red.service.persistence.management.v1.processor.service.
|
||||
@RequiredArgsConstructor
|
||||
public class ReportTemplateController implements ReportTemplateResource {
|
||||
|
||||
private final Auditor auditor;
|
||||
private final ReportTemplatePlaceholderClient reportTemplatePlaceholderClient;
|
||||
private final PlaceholderClient placeholderClient;
|
||||
private final DossierAttributeConfigPersistenceService dossierAttributeConfigPersistenceService;
|
||||
@ -78,8 +79,7 @@ public class ReportTemplateController implements ReportTemplateResource {
|
||||
public ReportTemplate uploadTemplate(@RequestPart(name = "file") MultipartFile file,
|
||||
@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId,
|
||||
@RequestParam(value = MULTI_FILE_REPORT, required = false, defaultValue = "false") boolean multiFileReport,
|
||||
@RequestParam(value = ACTIVE_BY_DEFAULT, required = false, defaultValue = "false") boolean activeByDefault,
|
||||
Auditor auditor) {
|
||||
@RequestParam(value = ACTIVE_BY_DEFAULT, required = false, defaultValue = "false") boolean activeByDefault) {
|
||||
|
||||
try {
|
||||
if (file.getOriginalFilename() != null) {
|
||||
@ -146,7 +146,7 @@ public class ReportTemplateController implements ReportTemplateResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + DELETE_REPORT_TEMPLATE + "')")
|
||||
public void deleteTemplate(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @PathVariable(TEMPLATE_ID) String templateId, Auditor auditor) {
|
||||
public void deleteTemplate(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @PathVariable(TEMPLATE_ID) String templateId) {
|
||||
|
||||
var storageId = reportTemplatePersistenceService.find(templateId).getStorageId();
|
||||
storageService.deleteObject(TenantContext.getTenantId(), storageId);
|
||||
|
||||
@ -41,12 +41,13 @@ public class RulesController implements RulesResource {
|
||||
|
||||
private static final String DOWNLOAD_FILE_NAME = "rules.drl";
|
||||
|
||||
private final Auditor auditor;
|
||||
private final RulesPersistenceService rulesPersistenceService;
|
||||
private final RulesValidationService rulesValidationService;
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + WRITE_RULES + "')")
|
||||
public ResponseEntity<?> upload(@RequestBody RulesUploadRequest rules, Auditor auditor) {
|
||||
public ResponseEntity<?> upload(@RequestBody RulesUploadRequest rules) {
|
||||
|
||||
DroolsSyntaxValidation droolsSyntaxValidation = rulesValidationService.validateRules(rules.getRuleFileType(), rules.getRules());
|
||||
if (!droolsSyntaxValidation.isCompiled()) {
|
||||
@ -85,9 +86,9 @@ public class RulesController implements RulesResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + WRITE_RULES + "')")
|
||||
public ResponseEntity<?> uploadFile(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, @RequestPart(name = "file") MultipartFile file, Auditor auditor) {
|
||||
public ResponseEntity<?> uploadFile(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, @RequestPart(name = "file") MultipartFile file) {
|
||||
|
||||
return uploadFile(dossierTemplateId, RuleFileType.ENTITY, file, auditor);
|
||||
return uploadFile(dossierTemplateId, RuleFileType.ENTITY, file);
|
||||
}
|
||||
|
||||
|
||||
@ -95,11 +96,10 @@ public class RulesController implements RulesResource {
|
||||
@PreAuthorize("hasAuthority('" + WRITE_RULES + "')")
|
||||
public ResponseEntity<?> uploadFile(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId,
|
||||
@PathVariable(RULE_FILE_TYPE_PARAMETER_NAME) RuleFileType ruleFileType,
|
||||
@RequestPart(name = "file") MultipartFile file,
|
||||
Auditor auditor) {
|
||||
@RequestPart(name = "file") MultipartFile file) {
|
||||
|
||||
try {
|
||||
return upload(new RulesUploadRequest(new String(file.getBytes(), StandardCharsets.UTF_8), dossierTemplateId, ruleFileType), auditor);
|
||||
return upload(new RulesUploadRequest(new String(file.getBytes(), StandardCharsets.UTF_8), dossierTemplateId, ruleFileType));
|
||||
} catch (IOException e) {
|
||||
throw new FileUploadException("Could not upload file.", e);
|
||||
}
|
||||
|
||||
@ -48,6 +48,8 @@ public class StatusController implements StatusResource {
|
||||
private static final String DOSSIER_ID = "dossierId";
|
||||
private static final String FILE_ID = "fileId";
|
||||
private static final String FILE_NAME = "fileName";
|
||||
|
||||
private final Auditor auditor;
|
||||
private final FileStatusManagementService fileStatusManagementService;
|
||||
private final UserService userService;
|
||||
private final DossierManagementService dossierManagementService;
|
||||
@ -146,8 +148,7 @@ public class StatusController implements StatusResource {
|
||||
@PreAuthorize("hasAuthority('" + SET_REVIEWER + "')")
|
||||
public void setCurrentFileAssignee(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestParam(name = ASSIGNEE_ID_REQUEST_PARAM, required = false) String assigneeId,
|
||||
Auditor auditor) {
|
||||
@RequestParam(name = ASSIGNEE_ID_REQUEST_PARAM, required = false) String assigneeId) {
|
||||
|
||||
accessControlService.verifyUserIsMemberOrApprover(dossierId);
|
||||
|
||||
@ -216,8 +217,7 @@ public class StatusController implements StatusResource {
|
||||
@PreAuthorize("hasAuthority('" + SET_REVIEWER + "')")
|
||||
public void setStatusUnderReview(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestParam(value = ASSIGNEE_ID_REQUEST_PARAM, required = false) String assigneeId,
|
||||
Auditor auditor) {
|
||||
@RequestParam(value = ASSIGNEE_ID_REQUEST_PARAM, required = false) String assigneeId) {
|
||||
|
||||
var fileStatus = fileStatusManagementService.getFileStatus(fileId);
|
||||
|
||||
@ -241,8 +241,7 @@ public class StatusController implements StatusResource {
|
||||
@PreAuthorize("hasAuthority('" + SET_STATUS_UNDER_APPROVAL + "')")
|
||||
public void setStatusUnderApproval(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestParam(name = ASSIGNEE_ID_REQUEST_PARAM, required = false) String assigneeId,
|
||||
Auditor auditor) {
|
||||
@RequestParam(name = ASSIGNEE_ID_REQUEST_PARAM, required = false) String assigneeId) {
|
||||
|
||||
var fileStatus = fileStatusManagementService.getFileStatus(fileId);
|
||||
|
||||
@ -265,7 +264,7 @@ public class StatusController implements StatusResource {
|
||||
|
||||
|
||||
@PreAuthorize("hasAuthority('" + SET_STATUS_APPROVED + "')")
|
||||
public void setStatusApproved(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, Auditor auditor) {
|
||||
public void setStatusApproved(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId) {
|
||||
|
||||
accessControlService.verifyUserIsApprover(dossierId);
|
||||
setStatusApprovedForFile(dossierId, fileId);
|
||||
@ -291,10 +290,9 @@ public class StatusController implements StatusResource {
|
||||
@PreAuthorize("hasAuthority('" + SET_REVIEWER + "')")
|
||||
public void setAssigneeForList(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@RequestParam(value = ASSIGNEE_ID_REQUEST_PARAM, required = false) String assigneeId,
|
||||
@RequestBody List<String> fileIds,
|
||||
Auditor auditor) {
|
||||
@RequestBody List<String> fileIds) {
|
||||
|
||||
fileIds.forEach(fileId -> setCurrentFileAssignee(dossierId, fileId, assigneeId, auditor));
|
||||
fileIds.forEach(fileId -> setCurrentFileAssignee(dossierId, fileId, assigneeId));
|
||||
}
|
||||
|
||||
|
||||
@ -302,10 +300,9 @@ public class StatusController implements StatusResource {
|
||||
@PreAuthorize("hasAuthority('" + SET_REVIEWER + "')")
|
||||
public void setStatusUnderReviewForList(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@RequestBody List<String> fileIds,
|
||||
@RequestParam(value = ASSIGNEE_ID_REQUEST_PARAM, required = false) String assigneeId,
|
||||
Auditor auditor) {
|
||||
@RequestParam(value = ASSIGNEE_ID_REQUEST_PARAM, required = false) String assigneeId) {
|
||||
|
||||
fileIds.forEach(fileId -> setStatusUnderReview(dossierId, fileId, assigneeId, auditor));
|
||||
fileIds.forEach(fileId -> setStatusUnderReview(dossierId, fileId, assigneeId));
|
||||
|
||||
}
|
||||
|
||||
@ -334,10 +331,9 @@ public class StatusController implements StatusResource {
|
||||
@PreAuthorize("hasAuthority('" + SET_STATUS_UNDER_APPROVAL + "')")
|
||||
public void setStatusUnderApprovalForList(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@RequestBody List<String> fileIds,
|
||||
@RequestParam(value = ASSIGNEE_ID_REQUEST_PARAM, required = false) String assigneeId,
|
||||
Auditor auditor) {
|
||||
@RequestParam(value = ASSIGNEE_ID_REQUEST_PARAM, required = false) String assigneeId) {
|
||||
|
||||
fileIds.forEach(fileId -> setStatusUnderApproval(dossierId, fileId, assigneeId, auditor));
|
||||
fileIds.forEach(fileId -> setStatusUnderApproval(dossierId, fileId, assigneeId));
|
||||
|
||||
}
|
||||
|
||||
@ -358,13 +354,13 @@ public class StatusController implements StatusResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + SET_STATUS_APPROVED + "')")
|
||||
public void setStatusApprovedForList(String dossierId, List<String> fileIds, Auditor auditor) {
|
||||
public void setStatusApprovedForList(String dossierId, List<String> fileIds) {
|
||||
|
||||
accessControlService.verifyUserIsApprover(dossierId);
|
||||
|
||||
dossierManagementService.getDossierById(dossierId, false, false);
|
||||
|
||||
fileIds.forEach(fileId -> setStatusApproved(dossierId, fileId, auditor));
|
||||
fileIds.forEach(fileId -> setStatusApproved(dossierId, fileId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -44,6 +44,7 @@ public class UploadController implements UploadResource {
|
||||
|
||||
private static final List<String> VALID_FILE_EXTENSIONS = List.of("pdf", "docx", "doc", "xls", "xlsx", "ppt", "pptx");
|
||||
|
||||
private final Auditor auditor;
|
||||
private final UploadService uploadService;
|
||||
private final ReanalysisService reanalysisService;
|
||||
private final AccessControlService accessControlService;
|
||||
@ -83,8 +84,7 @@ public class UploadController implements UploadResource {
|
||||
public void importRedactions(@RequestPart(name = "file") MultipartFile file,
|
||||
@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestParam(value = "pageInclusionRequest", required = false) Set<Integer> pageInclusionRequest,
|
||||
Auditor auditor) {
|
||||
@RequestParam(value = "pageInclusionRequest", required = false) Set<Integer> pageInclusionRequest) {
|
||||
|
||||
accessControlService.verifyFileIsNotApproved(dossierId, fileId);
|
||||
accessControlService.verifyUserIsReviewerOrApprover(dossierId, fileId);
|
||||
|
||||
@ -25,11 +25,12 @@ import static com.iqser.red.service.persistence.management.v1.processor.roles.Ac
|
||||
@RequiredArgsConstructor
|
||||
public class WatermarkController implements WatermarkResource {
|
||||
|
||||
private final Auditor auditor;
|
||||
private final WatermarkService watermarkService;
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + WRITE_WATERMARK + "')")
|
||||
public WatermarkModel saveWatermark(@RequestBody WatermarkModel watermark, Auditor auditor) {
|
||||
public WatermarkModel saveWatermark(@RequestBody WatermarkModel watermark) {
|
||||
|
||||
String userId = KeycloakSecurity.getUserId();
|
||||
watermark.setCreatedBy(userId);
|
||||
@ -57,7 +58,7 @@ public class WatermarkController implements WatermarkResource {
|
||||
|
||||
@Override
|
||||
@PreAuthorize("hasAuthority('" + WRITE_WATERMARK + "')")
|
||||
public void deleteWatermark(@PathVariable(WATERMARK_ID_PARAMETER_NAME) long watermarkId, Auditor auditor) {
|
||||
public void deleteWatermark(@PathVariable(WATERMARK_ID_PARAMETER_NAME) long watermarkId) {
|
||||
|
||||
String dossierTemplateId = watermarkService.getWatermark(watermarkId).getDossierTemplateId();
|
||||
watermarkService.deleteWatermark(watermarkId);
|
||||
|
||||
@ -2,8 +2,6 @@ package com.iqser.red.service.persistence.service.v1.api.external.resource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.knecon.fforesight.auditor.Auditor;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@ -71,8 +69,7 @@ public interface DictionaryResource {
|
||||
@RequestBody List<String> entries,
|
||||
@RequestParam(name = REMOVE_CURRENT_REQUEST_PARAM, defaultValue = "false", required = false) boolean removeCurrent,
|
||||
@RequestParam(value = DOSSIER_ID_PARAMETER_NAME, required = false) String dossierId,
|
||||
@RequestParam(value = DICTIONARY_ENTRY_TYPE_PARAM, required = false, defaultValue = DEFAULT_DICTIONARY_ENTRY_TYPE) DictionaryEntryType dictionaryEntryType,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestParam(value = DICTIONARY_ENTRY_TYPE_PARAM, required = false, defaultValue = DEFAULT_DICTIONARY_ENTRY_TYPE) DictionaryEntryType dictionaryEntryType);
|
||||
|
||||
|
||||
@ResponseStatus(HttpStatus.NO_CONTENT)
|
||||
@ -83,8 +80,7 @@ public interface DictionaryResource {
|
||||
@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId,
|
||||
@RequestBody List<String> entries,
|
||||
@RequestParam(value = DOSSIER_ID_PARAMETER_NAME, required = false) String dossierId,
|
||||
@RequestParam(value = DICTIONARY_ENTRY_TYPE_PARAM, required = false, defaultValue = DEFAULT_DICTIONARY_ENTRY_TYPE) DictionaryEntryType dictionaryEntryType,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestParam(value = DICTIONARY_ENTRY_TYPE_PARAM, required = false, defaultValue = DEFAULT_DICTIONARY_ENTRY_TYPE) DictionaryEntryType dictionaryEntryType);
|
||||
|
||||
|
||||
@ResponseStatus(HttpStatus.NO_CONTENT)
|
||||
@ -95,8 +91,7 @@ public interface DictionaryResource {
|
||||
@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId,
|
||||
@PathVariable(ENTRY_PARAMETER_NAME) String entry,
|
||||
@RequestParam(value = DOSSIER_ID_PARAMETER_NAME, required = false) String dossierId,
|
||||
@RequestParam(value = DICTIONARY_ENTRY_TYPE_PARAM, required = false, defaultValue = DEFAULT_DICTIONARY_ENTRY_TYPE) DictionaryEntryType dictionaryEntryType,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestParam(value = DICTIONARY_ENTRY_TYPE_PARAM, required = false, defaultValue = DEFAULT_DICTIONARY_ENTRY_TYPE) DictionaryEntryType dictionaryEntryType);
|
||||
|
||||
|
||||
@ResponseStatus(HttpStatus.NO_CONTENT)
|
||||
@ -105,15 +100,14 @@ public interface DictionaryResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "Successfully updated the colors, hint and caseInsensitive of entry type"), @ApiResponse(responseCode = "400", description = "Request contains error."), @ApiResponse(responseCode = "404", description = "The entry type is not found.")})
|
||||
void updateType(@PathVariable(TYPE_PARAMETER_NAME) String type,
|
||||
@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId,
|
||||
@RequestBody UpdateTypeValue typeValue,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestBody UpdateTypeValue typeValue);
|
||||
|
||||
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
@PostMapping(value = TYPE_PATH, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "Creates entry type with colors, hint and caseInsensitive", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "Successfully created the entry type with colors, hint " + "and caseInsensitive"), @ApiResponse(responseCode = "400", description = "Request contains error."), @ApiResponse(responseCode = "409", description = "The entry type already exists, could not be added again.")})
|
||||
TypeValue addType(@RequestBody CreateTypeValue typeValue, @Parameter(hidden = true) Auditor auditor);
|
||||
TypeValue addType(@RequestBody CreateTypeValue typeValue);
|
||||
|
||||
|
||||
@ResponseStatus(HttpStatus.NO_CONTENT)
|
||||
@ -121,7 +115,7 @@ public interface DictionaryResource {
|
||||
@Operation(summary = "Deletes entry type", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "Successfully deleted the entry type with value and all its entries"), @ApiResponse(responseCode = "400", description = "Request contains error."), @ApiResponse(responseCode = "404", description = "The entry type is not found.")})
|
||||
void deleteType(@PathVariable(TYPE_PARAMETER_NAME) String type,
|
||||
@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, @Parameter(hidden = true) Auditor auditor);
|
||||
@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId);
|
||||
|
||||
|
||||
@ResponseStatus(HttpStatus.NO_CONTENT)
|
||||
@ -129,7 +123,7 @@ public interface DictionaryResource {
|
||||
@Operation(summary = "Deletes entry types", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "Successfully deleted the entry types with value and all their entries"), @ApiResponse(responseCode = "400", description = "Request contains error."), @ApiResponse(responseCode = "404", description = "The entry type is not found.")})
|
||||
void deleteTypes(@RequestBody List<String> types,
|
||||
@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, @Parameter(hidden = true) Auditor auditor);
|
||||
@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId);
|
||||
|
||||
|
||||
@GetMapping(value = TYPE_PATH + DOSSIER_TEMPLATE_PATH_VARIABLE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@ -162,8 +156,7 @@ public interface DictionaryResource {
|
||||
@PathVariable(TYPE_PARAMETER_NAME) String type,
|
||||
@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId,
|
||||
@RequestParam(value = DOSSIER_ID_PARAMETER_NAME, required = false) String dossierId,
|
||||
@RequestParam(value = DICTIONARY_ENTRY_TYPE_PARAM, required = false, defaultValue = DEFAULT_DICTIONARY_ENTRY_TYPE) DictionaryEntryType dictionaryEntryType,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestParam(value = DICTIONARY_ENTRY_TYPE_PARAM, required = false, defaultValue = DEFAULT_DICTIONARY_ENTRY_TYPE) DictionaryEntryType dictionaryEntryType);
|
||||
|
||||
|
||||
/**
|
||||
@ -191,7 +184,7 @@ public interface DictionaryResource {
|
||||
@Operation(summary = "Set system colors for redaction")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "System colors update successful."), @ApiResponse(responseCode = "400", description = "System colors request contains error.")})
|
||||
@PostMapping(value = COLOR_REST_PATH + DOSSIER_TEMPLATE_PATH_VARIABLE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
void setColors(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, @RequestBody Colors colors, @Parameter(hidden = true) Auditor auditor);
|
||||
void setColors(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, @RequestBody Colors colors);
|
||||
|
||||
|
||||
@ResponseBody
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package com.iqser.red.service.persistence.service.v1.api.external.resource;
|
||||
|
||||
import com.knecon.fforesight.auditor.Auditor;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
@ -43,21 +41,21 @@ public interface DigitalSignatureResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "OK"), @ApiResponse(responseCode = "400", description = "Invalid Data."), @ApiResponse(responseCode = "403", description = "Forbidden.")})
|
||||
@ResponseStatus(HttpStatus.NO_CONTENT)
|
||||
@PostMapping(value = DIGITAL_SIGNATURE_TYPE_PATH + DIGITAL_SIGNATURE_TYPE_VARIABLE)
|
||||
void setActiveDigitalSignatureType(@PathVariable(DIGITAL_SIGNATURE_TYPE) DigitalSignatureType digitalSignatureType, @Parameter(hidden = true) Auditor auditor);
|
||||
void setActiveDigitalSignatureType(@PathVariable(DIGITAL_SIGNATURE_TYPE) DigitalSignatureType digitalSignatureType);
|
||||
|
||||
|
||||
@Operation(summary = "Save a new digital signature used to sign PDF's", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "201", description = "OK"), @ApiResponse(responseCode = "400", description = "Invalid Digital Signature Data."), @ApiResponse(responseCode = "403", description = "Forbidden.")})
|
||||
@ResponseStatus(HttpStatus.CREATED)
|
||||
@PostMapping(value = DIGITAL_SIGNATURE_PATH, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
DigitalSignatureViewModel saveDigitalSignature(@RequestBody DigitalSignature digitalSignatureModel, @Parameter(hidden = true) Auditor auditor);
|
||||
DigitalSignatureViewModel saveDigitalSignature(@RequestBody DigitalSignature digitalSignatureModel);
|
||||
|
||||
|
||||
@Operation(summary = "Update the digital signature used to sign PDF's", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "201", description = "OK"), @ApiResponse(responseCode = "400", description = "Invalid Digital Signature Data."), @ApiResponse(responseCode = "403", description = "Forbidden.")})
|
||||
@ResponseStatus(HttpStatus.CREATED)
|
||||
@PutMapping(value = DIGITAL_SIGNATURE_PATH, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
void updateDigitalSignature(@RequestBody DigitalSignatureViewModel digitalSignatureModel, @Parameter(hidden = true) Auditor auditor);
|
||||
void updateDigitalSignature(@RequestBody DigitalSignatureViewModel digitalSignatureModel);
|
||||
|
||||
|
||||
@Operation(summary = "Get the current digital signature", description = "None")
|
||||
@ -70,14 +68,14 @@ public interface DigitalSignatureResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "OK"), @ApiResponse(responseCode = "403", description = "Forbidden.")})
|
||||
@ResponseStatus(HttpStatus.NO_CONTENT)
|
||||
@DeleteMapping(value = DIGITAL_SIGNATURE_PATH)
|
||||
void deleteDigitalSignature(@Parameter(hidden = true) Auditor auditor);
|
||||
void deleteDigitalSignature();
|
||||
|
||||
|
||||
@Operation(summary = "Save a new digital KMS signature used to sign PDF's", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "201", description = "OK"), @ApiResponse(responseCode = "400", description = "Invalid Digital Signature Data."), @ApiResponse(responseCode = "403", description = "Forbidden.")})
|
||||
@ResponseStatus(HttpStatus.CREATED)
|
||||
@PostMapping(value = DIGITAL_SIGNATURE_KMS_PATH, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
DigitalSignatureKmsViewModel saveDigitalSignatureKms(@RequestBody DigitalSignatureKms digitalSignature, @Parameter(hidden = true) Auditor auditor);
|
||||
DigitalSignatureKmsViewModel saveDigitalSignatureKms(@RequestBody DigitalSignatureKms digitalSignature);
|
||||
|
||||
|
||||
@Operation(summary = "Get the current digital KMS signature", description = "None")
|
||||
@ -90,6 +88,6 @@ public interface DigitalSignatureResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "OK"), @ApiResponse(responseCode = "403", description = "Forbidden.")})
|
||||
@ResponseStatus(HttpStatus.NO_CONTENT)
|
||||
@DeleteMapping(value = DIGITAL_SIGNATURE_KMS_PATH)
|
||||
void deleteDigitalSignatureKms(@Parameter(hidden = true) Auditor auditor);
|
||||
void deleteDigitalSignatureKms();
|
||||
|
||||
}
|
||||
|
||||
@ -2,8 +2,6 @@ package com.iqser.red.service.persistence.service.v1.api.external.resource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.knecon.fforesight.auditor.Auditor;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
@ -51,7 +49,7 @@ public interface DossierAttributesResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
|
||||
|
||||
@PutMapping(value = DOSSIER_ATTRIBUTES_PATH + CONFIG_PATH + DOSSIER_TEMPLATE_ID_PATH_VARIABLE, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
DossierAttributesConfig setDossierAttributesConfig(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @RequestBody DossierAttributesConfig dossierAttributesConfig, @Parameter(hidden = true) Auditor auditor);
|
||||
DossierAttributesConfig setDossierAttributesConfig(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @RequestBody DossierAttributesConfig dossierAttributesConfig);
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@ -59,7 +57,7 @@ public interface DossierAttributesResource {
|
||||
@Operation(summary = "Add or update a dossier attribute in base configuration.", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
|
||||
@PostMapping(value = DOSSIER_ATTRIBUTES_PATH + CONFIG_PATH + DOSSIER_TEMPLATE_ID_PATH_VARIABLE, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
DossierAttributeConfig addOrUpdateDossierAttributeConfig(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @RequestBody DossierAttributeConfig dossierAttributes, @Parameter(hidden = true) Auditor auditor);
|
||||
DossierAttributeConfig addOrUpdateDossierAttributeConfig(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @RequestBody DossierAttributeConfig dossierAttributes);
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@ -67,7 +65,7 @@ public interface DossierAttributesResource {
|
||||
@Operation(summary = "Delete a specific dossier attribute.", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "NO_CONTENT")})
|
||||
@DeleteMapping(value = DOSSIER_ATTRIBUTES_PATH + CONFIG_PATH + DOSSIER_TEMPLATE_ID_PATH_VARIABLE + DOSSIER_ATTRIBUTE_ID_PATH)
|
||||
void deleteDossierAttributeConfig(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @PathVariable(DOSSIER_ATTRIBUTE_ID) String dossierAttributeId, @Parameter(hidden = true) Auditor auditor);
|
||||
void deleteDossierAttributeConfig(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @PathVariable(DOSSIER_ATTRIBUTE_ID) String dossierAttributeId);
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@ -75,7 +73,7 @@ public interface DossierAttributesResource {
|
||||
@Operation(summary = "Bulk delete dossier attributes.", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "NO_CONTENT")})
|
||||
@PostMapping(value = DOSSIER_ATTRIBUTES_PATH + CONFIG_PATH + DELETE_PATH + DOSSIER_TEMPLATE_ID_PATH_VARIABLE)
|
||||
void deleteDossierAttributesConfig(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @RequestParam(DOSSIER_ATTRIBUTE_IDS) List<String> dossierAttributeIds, @Parameter(hidden = true) Auditor auditor);
|
||||
void deleteDossierAttributesConfig(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @RequestParam(DOSSIER_ATTRIBUTE_IDS) List<String> dossierAttributeIds);
|
||||
|
||||
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
@ -90,7 +88,7 @@ public interface DossierAttributesResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
|
||||
|
||||
@PostMapping(value = DOSSIER_ATTRIBUTES_PATH + SET_PATH + DOSSIER_ID_PATH_VARIABLE, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
DossierAttributes setDossierAttributes(@PathVariable(DOSSIER_ID) String dossierId, @RequestBody DossierAttributes dossierAttributes, @Parameter(hidden = true) Auditor auditor);
|
||||
DossierAttributes setDossierAttributes(@PathVariable(DOSSIER_ID) String dossierId, @RequestBody DossierAttributes dossierAttributes);
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@ -99,7 +97,7 @@ public interface DossierAttributesResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
|
||||
|
||||
@PostMapping(value = DOSSIER_ATTRIBUTES_PATH + UPDATE_PATH + DOSSIER_ID_PATH_VARIABLE, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
DossierAttributes addOrUpdateDossierAttribute(@PathVariable(DOSSIER_ID) String dossierId, @RequestBody DossierAttribute dossierAttribute, @Parameter(hidden = true) Auditor auditor);
|
||||
DossierAttributes addOrUpdateDossierAttribute(@PathVariable(DOSSIER_ID) String dossierId, @RequestBody DossierAttribute dossierAttribute);
|
||||
|
||||
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
@ -107,7 +105,7 @@ public interface DossierAttributesResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
|
||||
|
||||
@GetMapping(value = DOSSIER_ATTRIBUTES_PATH + DOSSIER_ID_PATH_VARIABLE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
DossierAttributes getDossierAttributes(@PathVariable(DOSSIER_ID) String dossierId, @Parameter(hidden = true) Auditor auditor);
|
||||
DossierAttributes getDossierAttributes(@PathVariable(DOSSIER_ID) String dossierId);
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@ -116,6 +114,6 @@ public interface DossierAttributesResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "NO_CONTENT")})
|
||||
|
||||
@DeleteMapping(value = DOSSIER_ATTRIBUTES_PATH + SET_PATH + DOSSIER_ID_PATH_VARIABLE + DOSSIER_ATTRIBUTE_ID_PATH)
|
||||
void deleteDossierAttribute(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(DOSSIER_ATTRIBUTE_ID) String dossierAttributeId, @Parameter(hidden = true) Auditor auditor);
|
||||
void deleteDossierAttribute(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(DOSSIER_ATTRIBUTE_ID) String dossierAttributeId);
|
||||
|
||||
}
|
||||
|
||||
@ -4,8 +4,6 @@ import java.time.OffsetDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.knecon.fforesight.auditor.Auditor;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@ -69,14 +67,14 @@ public interface DossierResource {
|
||||
@PostMapping(value = DOSSIER_REST_PATH, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "Creates or updates a dossier.", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Successfully saved the dossier."), @ApiResponse(responseCode = "400", description = "Incorrect dossier ID provided or attempted to change dossier-template for a dossier with files."), @ApiResponse(responseCode = "409", description = "Duplicate")})
|
||||
ResponseEntity<Dossier> createDossierOrUpdateDossier(@RequestBody DossierRequest dossier, @Parameter(hidden = true) Auditor auditor);
|
||||
ResponseEntity<Dossier> createDossierOrUpdateDossier(@RequestBody DossierRequest dossier);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
@DeleteMapping(value = DOSSIER_REST_PATH + DOSSIER_ID_PATH_PARAM)
|
||||
@Operation(summary = "Deletes an existing dossier.", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "Successfully deleted the dossier."), @ApiResponse(responseCode = "404", description = "Not found")})
|
||||
void deleteDossier(@PathVariable(DOSSIER_ID_PARAM) String dossierId, @Parameter(hidden = true) Auditor auditor);
|
||||
void deleteDossier(@PathVariable(DOSSIER_ID_PARAM) String dossierId);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.OK)
|
||||
@ -136,27 +134,27 @@ public interface DossierResource {
|
||||
@PostMapping(value = ARCHIVE_DOSSIERS_PATH + ARCHIVE_PATH)
|
||||
@Operation(summary = "Archives an existing dossier.", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "Successfully archived the dossier."), @ApiResponse(responseCode = "400", description = "Incorrect dossier ID entered to archive dossier."), @ApiResponse(responseCode = "403", description = "Forbidden operation while archiving."), @ApiResponse(responseCode = "404", description = "Dossier not found")})
|
||||
void archiveDossiers(@RequestBody Set<String> dossierIds, @Parameter(hidden = true) Auditor auditor);
|
||||
void archiveDossiers(@RequestBody Set<String> dossierIds);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
@PostMapping(value = ARCHIVE_DOSSIERS_PATH + UNARCHIVE_PATH, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "Restores archived dossiers.", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "Successfully restored the dossiers."), @ApiResponse(responseCode = "400", description = "Incorrect dossier ID entered to restore dossier."), @ApiResponse(responseCode = "403", description = "Forbidden operation while restoring."), @ApiResponse(responseCode = "404", description = "Dossier not found"), @ApiResponse(responseCode = "409", description = "Conflict occurred while restoring.")})
|
||||
void unarchiveDossiers(@RequestBody Set<String> dossierIds, @Parameter(hidden = true) Auditor auditor);
|
||||
void unarchiveDossiers(@RequestBody Set<String> dossierIds);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
@DeleteMapping(value = DELETED_DOSSIERS_PATH + HARD_DELETE_PATH)
|
||||
@Operation(summary = "Hard deletes existing dossiers.", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "Successfully hard deleted the dossier."), @ApiResponse(responseCode = "404", description = "Not found")})
|
||||
void hardDeleteDossiers(@RequestParam(DOSSIER_ID_PARAM) Set<String> dossierIds, @Parameter(hidden = true) Auditor auditor);
|
||||
void hardDeleteDossiers(@RequestParam(DOSSIER_ID_PARAM) Set<String> dossierIds);
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = DELETED_DOSSIERS_PATH + UNDELETE_PATH, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "Restores dossiers.", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "201", description = "Successfully restored the dossiers."), @ApiResponse(responseCode = "400", description = "Incorrect dossier ID entered to restore dossier."), @ApiResponse(responseCode = "403", description = "Forbidden operation while restoring."), @ApiResponse(responseCode = "409", description = "Conflict occurred while restoring.")})
|
||||
void undeleteDossiers(@RequestBody Set<String> dossierIds, @Parameter(hidden = true) Auditor auditor);
|
||||
void undeleteDossiers(@RequestBody Set<String> dossierIds);
|
||||
|
||||
}
|
||||
|
||||
@ -2,8 +2,6 @@ package com.iqser.red.service.persistence.service.v1.api.external.resource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.knecon.fforesight.auditor.Auditor;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
@ -41,7 +39,7 @@ public interface DossierTemplateResource {
|
||||
@PostMapping(value = DOSSIER_TEMPLATE_PATH, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "Creates a new DossierTemplates or updates an existing one.", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "202", description = "Successfully created DossierTemplates."), @ApiResponse(responseCode = "400", description = "The create/update request is not valid."), @ApiResponse(responseCode = "409", description = "The create/update request is not valid.")})
|
||||
DossierTemplateModel createOrUpdateDossierTemplate(@RequestBody DossierTemplateModel dossierTemplate, @Parameter(hidden = true) Auditor auditor);
|
||||
DossierTemplateModel createOrUpdateDossierTemplate(@RequestBody DossierTemplateModel dossierTemplate);
|
||||
|
||||
|
||||
@GetMapping(value = DOSSIER_TEMPLATE_PATH, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@ -60,20 +58,20 @@ public interface DossierTemplateResource {
|
||||
@DeleteMapping(value = DOSSIER_TEMPLATE_PATH + DOSSIER_TEMPLATE_ID_PATH_VARIABLE)
|
||||
@Operation(summary = "Delete a specific DossierTemplate by its ID", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "The DossierTemplate was deleted"), @ApiResponse(responseCode = "404", description = "The DossierTemplate is not found.")})
|
||||
void deleteDossierTemplate(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @Parameter(hidden = true) Auditor auditor);
|
||||
void deleteDossierTemplate(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
@PostMapping(value = DOSSIER_TEMPLATE_PATH + "/delete")
|
||||
@Operation(summary = "Delete multiple DossierTemplates by their IDs", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "The DossierTemplates were deleted"), @ApiResponse(responseCode = "404", description = "DossierTemplates not found.")})
|
||||
void deleteDossierTemplates(@RequestBody List<String> dossierTemplateIds, @Parameter(hidden = true) Auditor auditor);
|
||||
void deleteDossierTemplates(@RequestBody List<String> dossierTemplateIds);
|
||||
|
||||
|
||||
@PostMapping(value = DOSSIER_TEMPLATE_PATH + DOSSIER_TEMPLATE_ID_PATH_VARIABLE + CLONE_PATH, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "Clones a dossier template.", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Successfully cloned dossier templates."), @ApiResponse(responseCode = "400", description = "The clone request is not valid."), @ApiResponse(responseCode = "409", description = "The clone request is not valid.")})
|
||||
DossierTemplateModel cloneDossierTemplate(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @RequestBody CloneDossierTemplateRequest cloneDossierTemplateRequest, @Parameter(hidden = true) Auditor auditor);
|
||||
DossierTemplateModel cloneDossierTemplate(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @RequestBody CloneDossierTemplateRequest cloneDossierTemplateRequest);
|
||||
|
||||
|
||||
@Operation(summary = "Get Stats for a specific DossierTemplate", description = "None")
|
||||
@ -91,7 +89,7 @@ public interface DossierTemplateResource {
|
||||
@Operation(summary = "Prepares an export download for given dossier template", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Success."), @ApiResponse(responseCode = "400", description = "Request contains error."), @ApiResponse(responseCode = "404", description = "Dossier template not found.")})
|
||||
@GetMapping(value = DOSSIER_TEMPLATE_PATH + DOSSIER_TEMPLATE_ID_PATH_VARIABLE + EXPORT_PATH, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
DownloadResponse prepareExportDownload(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @Parameter(hidden = true) Auditor auditor);
|
||||
DownloadResponse prepareExportDownload(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
@ -100,6 +98,6 @@ public interface DossierTemplateResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "Archive have successfully imported"), @ApiResponse(responseCode = "400", description = "Validation failed during import"), @ApiResponse(responseCode = "404", description = "The dossier template to update does not exist")})
|
||||
DossierTemplateModel importDossierTemplate(@RequestPart(name = "file") MultipartFile file,
|
||||
@RequestParam(value = DOSSIER_TEMPLATE_ID, required = false) String dossierTemplateId,
|
||||
@RequestParam(value = "updateExistingDossierTemplate", required = false, defaultValue = "false") boolean updateExistingDossierTemplate, @Parameter(hidden = true) Auditor auditor);
|
||||
@RequestParam(value = "updateExistingDossierTemplate", required = false, defaultValue = "false") boolean updateExistingDossierTemplate);
|
||||
|
||||
}
|
||||
|
||||
@ -2,9 +2,6 @@ package com.iqser.red.service.persistence.service.v1.api.external.resource;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
import com.knecon.fforesight.auditor.Auditor;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
import org.springframework.core.io.InputStreamResource;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
@ -45,19 +42,19 @@ public interface DownloadResource {
|
||||
@Operation(summary = "Prepares a download for given fileIds and types", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Success."), @ApiResponse(responseCode = "400", description = "Request contains error."), @ApiResponse(responseCode = "404", description = "Dossier or file not found.")})
|
||||
@PostMapping(value = REST_PATH + "/prepare", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
DownloadResponse prepareDownload(@RequestBody PrepareDownloadRequest request, @Parameter(hidden = true) Auditor auditor);
|
||||
DownloadResponse prepareDownload(@RequestBody PrepareDownloadRequest request);
|
||||
|
||||
|
||||
@Operation(summary = "Prepares a download for given fileIds and types and reports", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Success."), @ApiResponse(responseCode = "400", description = "Request contains error."), @ApiResponse(responseCode = "404", description = "Dossier or file not found.")})
|
||||
@PostMapping(value = REST_PATH + "/prepare-option", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
DownloadResponse prepareDownload(@RequestBody PrepareDownloadWithOptionRequest request, @Parameter(hidden = true) Auditor auditor);
|
||||
DownloadResponse prepareDownload(@RequestBody PrepareDownloadWithOptionRequest request);
|
||||
|
||||
|
||||
@Operation(summary = "Removes a previously created download status", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Success."), @ApiResponse(responseCode = "404", description = "StorageId does not exist.")})
|
||||
@PostMapping(value = REST_PATH + "/delete", consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
void deleteDownloadStatus(@RequestBody RemoveDownloadRequest removeDownloadRequest, @Parameter(hidden = true) Auditor auditor);
|
||||
void deleteDownloadStatus(@RequestBody RemoveDownloadRequest removeDownloadRequest);
|
||||
|
||||
|
||||
@Operation(summary = "Gets to download status for the current user", description = "None")
|
||||
@ -72,7 +69,7 @@ public interface DownloadResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "404", description = "Download with this Id is no longer available")})
|
||||
@GetMapping(value = REST_PATH)
|
||||
CompletableFuture<ResponseEntity<InputStreamResource>> downloadFile(@RequestParam(STORAGE_ID) String storageId,
|
||||
@RequestParam(value = "inline", required = false, defaultValue = FALSE) boolean inline, @Parameter(hidden = true) Auditor auditor);
|
||||
@RequestParam(value = "inline", required = false, defaultValue = FALSE) boolean inline);
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@ -90,6 +87,6 @@ public interface DownloadResource {
|
||||
@GetMapping(value = REST_PATH + OTT_PATH + OTT_PATH_VARIABLE)
|
||||
CompletableFuture<ResponseEntity<InputStreamResource>> downloadFileUsingOTT(@PathVariable(OTT) String oneTimeToken,
|
||||
@RequestParam(value = "inline", required = false, defaultValue = FALSE) boolean inline,
|
||||
@RequestParam(value = "tenantId") String tenantId, @Parameter(hidden = true) Auditor auditor);
|
||||
@RequestParam(value = "tenantId") String tenantId);
|
||||
|
||||
}
|
||||
|
||||
@ -3,8 +3,6 @@ package com.iqser.red.service.persistence.service.v1.api.external.resource;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.knecon.fforesight.auditor.Auditor;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
@ -53,7 +51,7 @@ public interface FileAttributesResource {
|
||||
@Operation(summary = "Set file attributes base configuration and a list of file attributes, ", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
|
||||
@PutMapping(value = FILE_ATTRIBUTES_PATH + CONFIG_PATH + BASE_CONFIG_PATH + DOSSIER_TEMPLATE_ID_PATH_VARIABLE, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
FileAttributesConfig setFileAttributesConfig(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @RequestBody FileAttributesConfig fileAttributesConfig, @Parameter(hidden = true) Auditor auditor);
|
||||
FileAttributesConfig setFileAttributesConfig(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @RequestBody FileAttributesConfig fileAttributesConfig);
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@ -61,7 +59,7 @@ public interface FileAttributesResource {
|
||||
@Operation(summary = "Add or update a file attribute that can be used at importing csv.", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
|
||||
@PostMapping(value = FILE_ATTRIBUTES_PATH + CONFIG_PATH + FILE_ATTRIBUTE_PATH + DOSSIER_TEMPLATE_ID_PATH_VARIABLE, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
FileAttributeConfig addOrUpdateFileAttribute(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @RequestBody FileAttributeConfig fileAttributes, @Parameter(hidden = true) Auditor auditor);
|
||||
FileAttributeConfig addOrUpdateFileAttribute(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @RequestBody FileAttributeConfig fileAttributes);
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@ -70,7 +68,7 @@ public interface FileAttributesResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "NO_CONTENT")})
|
||||
|
||||
@DeleteMapping(value = FILE_ATTRIBUTES_PATH + CONFIG_PATH + FILE_ATTRIBUTE_PATH + DOSSIER_TEMPLATE_ID_PATH_VARIABLE + FILE_ATTRIBUTE_ID_PATH_VARIABLE)
|
||||
void deleteFileAttribute(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @PathVariable(FILE_ATTRIBUTE_ID) String fileAttributeId, @Parameter(hidden = true) Auditor auditor);
|
||||
void deleteFileAttribute(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @PathVariable(FILE_ATTRIBUTE_ID) String fileAttributeId);
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@ -79,7 +77,7 @@ public interface FileAttributesResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "NO_CONTENT")})
|
||||
|
||||
@PostMapping(value = FILE_ATTRIBUTES_PATH + CONFIG_PATH + FILE_ATTRIBUTE_PATH + DOSSIER_TEMPLATE_ID_PATH_VARIABLE + "/delete")
|
||||
void deleteFileAttributes(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @RequestBody List<String> fileAttributeIds, @Parameter(hidden = true) Auditor auditor);
|
||||
void deleteFileAttributes(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @RequestBody List<String> fileAttributeIds);
|
||||
|
||||
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
@ -94,6 +92,6 @@ public interface FileAttributesResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
|
||||
|
||||
@PostMapping(value = FILE_ATTRIBUTES_PATH + SET_PATH + DOSSIER_ID_PATH_PARAM + FILE_ID_PATH_VARIABLE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
void setFileAttributes(@PathVariable(DOSSIER_ID_PARAM) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody FileAttributes fileAttributes, @Parameter(hidden = true) Auditor auditor);
|
||||
void setFileAttributes(@PathVariable(DOSSIER_ID_PARAM) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody FileAttributes fileAttributes);
|
||||
|
||||
}
|
||||
|
||||
@ -3,8 +3,6 @@ package com.iqser.red.service.persistence.service.v1.api.external.resource;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.knecon.fforesight.auditor.Auditor;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@ -46,14 +44,14 @@ public interface FileManagementResource {
|
||||
@DeleteMapping(value = DELETE_PATH + DOSSIER_ID_PATH_VARIABLE + FILE_ID_PATH_VARIABLE)
|
||||
@Operation(summary = "Deletes a file for a given dossierId and FileId", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "OK")})
|
||||
void deleteFile(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @Parameter(hidden = true) Auditor auditor);
|
||||
void deleteFile(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
@PostMapping(value = DELETE_PATH + DOSSIER_ID_PATH_VARIABLE)
|
||||
@Operation(summary = "Deletes a a list of files for a given dossierId", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "OK")})
|
||||
void deleteFiles(@PathVariable(DOSSIER_ID) String dossierId, @RequestBody List<String> fileIds, @Parameter(hidden = true) Auditor auditor);
|
||||
void deleteFiles(@PathVariable(DOSSIER_ID) String dossierId, @RequestBody List<String> fileIds);
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@ -80,7 +78,7 @@ public interface FileManagementResource {
|
||||
@DeleteMapping(value = HARD_DELETE_PATH + DOSSIER_ID_PATH_VARIABLE)
|
||||
@Operation(summary = "Hard deletes an uploaded file.", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "Successfully hard deleted the file."), @ApiResponse(responseCode = "404", description = "Not found")})
|
||||
void hardDeleteFiles(@PathVariable(DOSSIER_ID) String dossierId, @RequestParam(FILE_IDS) Set<String> fileIds, @Parameter(hidden = true) Auditor auditor);
|
||||
void hardDeleteFiles(@PathVariable(DOSSIER_ID) String dossierId, @RequestParam(FILE_IDS) Set<String> fileIds);
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@ -88,13 +86,13 @@ public interface FileManagementResource {
|
||||
@PostMapping(value = UNDELETE_PATH + DOSSIER_ID_PATH_VARIABLE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "Restores an deleted file.", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "201", description = "File successfully restored."), @ApiResponse(responseCode = "400", description = "Incorrect dossier ID or file ID entered to restore file."), @ApiResponse(responseCode = "403", description = "Forbidden operation while restoring."), @ApiResponse(responseCode = "409", description = "Conflict occurred while restoring.")})
|
||||
void restoreFiles(@PathVariable(DOSSIER_ID) String dossierId, @RequestBody Set<String> fileIds, @Parameter(hidden = true) Auditor auditor);
|
||||
void restoreFiles(@PathVariable(DOSSIER_ID) String dossierId, @RequestBody Set<String> fileIds);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
@PostMapping(value = ROTATION_PATH + DOSSIER_ID_PATH_VARIABLE + FILE_ID_PATH_VARIABLE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "Rotates one or more pages for one file.", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "Pages successfully rotated."), @ApiResponse(responseCode = "400", description = "Incorrect dossier ID, file ID, pages or rotation entered."), @ApiResponse(responseCode = "403", description = "Forbidden operation while rotating.")})
|
||||
void rotatePages(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody RotatePagesRequest rotatePagesRequest, @Parameter(hidden = true) Auditor auditor);
|
||||
void rotatePages(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody RotatePagesRequest rotatePagesRequest);
|
||||
|
||||
}
|
||||
|
||||
@ -2,8 +2,6 @@ package com.iqser.red.service.persistence.service.v1.api.external.resource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.knecon.fforesight.auditor.Auditor;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -32,21 +30,21 @@ public interface LegalBasisMappingResource {
|
||||
@PostMapping(value = LEGAL_BASIS_PATH + DOSSIER_TEMPLATE_PATH_VARIABLE + DELETE_PATH, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "delete some legal basis by their names.", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "OK")})
|
||||
void deleteLegalBasis(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, @RequestBody List<String> legalBasisNames, @Parameter(hidden = true) Auditor auditor);
|
||||
void deleteLegalBasis(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, @RequestBody List<String> legalBasisNames);
|
||||
|
||||
|
||||
@ResponseStatus(HttpStatus.NO_CONTENT)
|
||||
@PutMapping(value = LEGAL_BASIS_PATH + DOSSIER_TEMPLATE_PATH_VARIABLE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "Add or update one legalBasis.", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "OK")})
|
||||
void addOrUpdateLegalBasis(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, @RequestBody LegalBasis legalBasis, @Parameter(hidden = true) Auditor auditor);
|
||||
void addOrUpdateLegalBasis(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, @RequestBody LegalBasis legalBasis);
|
||||
|
||||
|
||||
@ResponseStatus(HttpStatus.NO_CONTENT)
|
||||
@PostMapping(value = LEGAL_BASIS_PATH + DOSSIER_TEMPLATE_PATH_VARIABLE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "Set the mapping between legal basis and redaction reason.", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "OK")})
|
||||
void setLegalBasisMapping(@RequestBody List<LegalBasis> legalBasisMapping, @PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, @Parameter(hidden = true) Auditor auditor);
|
||||
void setLegalBasisMapping(@RequestBody List<LegalBasis> legalBasisMapping, @PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId);
|
||||
|
||||
|
||||
@ResponseBody
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package com.iqser.red.service.persistence.service.v1.api.external.resource;
|
||||
|
||||
import com.knecon.fforesight.auditor.Auditor;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@ -26,6 +24,6 @@ public interface LicenseReportResource {
|
||||
@PostMapping(value = LICENSE_REPORT_PATH, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "Creates and serves license report.", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Successfully created and served a license report.")})
|
||||
LicenseReport getReport(@RequestBody LicenseReportRequest reportRequest, @Parameter(hidden = true) Auditor auditor);
|
||||
LicenseReport getReport(@RequestBody LicenseReportRequest reportRequest);
|
||||
|
||||
}
|
||||
|
||||
@ -3,8 +3,6 @@ package com.iqser.red.service.persistence.service.v1.api.external.resource;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.knecon.fforesight.auditor.Auditor;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
@ -61,8 +59,7 @@ public interface ManualRedactionResource {
|
||||
CommentResponse addComment(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@PathVariable(ANNOTATION_ID) String annotationId,
|
||||
@RequestBody AddCommentRequestModel addCommentRequest,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestBody AddCommentRequestModel addCommentRequest);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
@ -72,8 +69,7 @@ public interface ManualRedactionResource {
|
||||
void undoComment(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@PathVariable(ANNOTATION_ID) String annotationId,
|
||||
@PathVariable(COMMENT_ID) String commentId,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@PathVariable(COMMENT_ID) String commentId);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.OK)
|
||||
@ -82,8 +78,7 @@ public interface ManualRedactionResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
|
||||
List<ManualAddResponse> addRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestBody Set<AddRedactionRequestModel> addRedactionRequest,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestBody Set<AddRedactionRequestModel> addRedactionRequest);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.OK)
|
||||
@ -92,8 +87,7 @@ public interface ManualRedactionResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
|
||||
List<ManualAddResponse> removeRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestBody Set<RemoveRedactionRequestModel> removeRedactionRequests,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestBody Set<RemoveRedactionRequestModel> removeRedactionRequests);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.OK)
|
||||
@ -102,8 +96,7 @@ public interface ManualRedactionResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
|
||||
List<ManualAddResponse> forceRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestBody Set<ForceRedactionRequestModel> forceRedactionRequests,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestBody Set<ForceRedactionRequestModel> forceRedactionRequests);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.OK)
|
||||
@ -112,8 +105,7 @@ public interface ManualRedactionResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
|
||||
List<ManualAddResponse> legalBasisChangeBulk(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestBody Set<LegalBasisChangeRequestModel> legalBasisChangeRequests,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestBody Set<LegalBasisChangeRequestModel> legalBasisChangeRequests);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.OK)
|
||||
@ -122,8 +114,7 @@ public interface ManualRedactionResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
|
||||
List<ManualAddResponse> recategorizeBulk(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestBody Set<RecategorizationRequestModel> recategorizationRequests,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestBody Set<RecategorizationRequestModel> recategorizationRequests);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.OK)
|
||||
@ -132,8 +123,7 @@ public interface ManualRedactionResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
|
||||
List<ManualAddResponse> resizeRedactionBulk(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestBody Set<ResizeRedactionRequestModel> resizeRedactionRequests,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestBody Set<ResizeRedactionRequestModel> resizeRedactionRequests);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.OK)
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package com.iqser.red.service.persistence.service.v1.api.external.resource;
|
||||
|
||||
import com.knecon.fforesight.auditor.Auditor;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -53,7 +51,7 @@ public interface RSSResource {
|
||||
@PostMapping(value = RSS_PATH + OVERRIDE_PATH + DOSSIER_ID_PATH_VARIABLE + FILE_ID_PATH_VARIABLE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "Adds overrides for RSS components", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
|
||||
void addOverrides(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody ComponentsOverrides componentsOverrides, @Parameter(hidden = true) Auditor auditor);
|
||||
void addOverrides(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody ComponentsOverrides componentsOverrides);
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@ -69,6 +67,6 @@ public interface RSSResource {
|
||||
@PostMapping(value = RSS_PATH + OVERRIDE_PATH + "/revert" + DOSSIER_ID_PATH_VARIABLE + FILE_ID_PATH_VARIABLE, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "Reverts overrides for RSS components", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
|
||||
void revertOverrides(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody RevertOverrideRequest revertOverrideRequest, @Parameter(hidden = true) Auditor auditor);
|
||||
void revertOverrides(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody RevertOverrideRequest revertOverrideRequest);
|
||||
|
||||
}
|
||||
|
||||
@ -3,8 +3,6 @@ package com.iqser.red.service.persistence.service.v1.api.external.resource;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.knecon.fforesight.auditor.Auditor;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@ -45,7 +43,7 @@ public interface ReanalysisResource {
|
||||
@PostMapping(value = REANALYSIS_REST_PATH + DOSSIER_ID_PATH_VARIABLE)
|
||||
@Operation(summary = "Reanalyze all files of the dossier.", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "OK")})
|
||||
void reanalyzeDossier(@PathVariable(DOSSIER_ID) String dossierId, @RequestParam(value = FORCE_PARAM, required = false, defaultValue = FALSE) boolean force, @Parameter(hidden = true) Auditor auditor);
|
||||
void reanalyzeDossier(@PathVariable(DOSSIER_ID) String dossierId, @RequestParam(value = FORCE_PARAM, required = false, defaultValue = FALSE) boolean force);
|
||||
|
||||
|
||||
@PostMapping(value = REANALYSIS_REST_PATH + DOSSIER_ID_PATH_VARIABLE + FILE_ID_PATH_VARIABLE)
|
||||
@ -53,8 +51,7 @@ public interface ReanalysisResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "OK")})
|
||||
void reanalyzeFile(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestParam(value = FORCE_PARAM, required = false, defaultValue = FALSE) boolean force,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestParam(value = FORCE_PARAM, required = false, defaultValue = FALSE) boolean force);
|
||||
|
||||
|
||||
@PostMapping(value = REANALYSIS_REST_PATH + DOSSIER_ID_PATH_VARIABLE + BULK_REST_PATH)
|
||||
@ -62,14 +59,13 @@ public interface ReanalysisResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "OK")})
|
||||
void reanalyzeFilesForDossier(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@RequestBody List<String> fileIds,
|
||||
@RequestParam(value = FORCE_PARAM, required = false, defaultValue = FALSE) boolean force,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestParam(value = FORCE_PARAM, required = false, defaultValue = FALSE) boolean force);
|
||||
|
||||
|
||||
@Operation(summary = "Ocr and reanalyze a dossier", description = "None")
|
||||
@PostMapping(value = OCR_REANALYSIS_REST_PATH + DOSSIER_ID_PATH_VARIABLE)
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "OK")})
|
||||
void ocrDossier(@PathVariable(DOSSIER_ID) String dossierId, @Parameter(hidden = true) Auditor auditor);
|
||||
void ocrDossier(@PathVariable(DOSSIER_ID) String dossierId);
|
||||
|
||||
|
||||
@Operation(summary = "Ocr and reanalyze a file", description = "None")
|
||||
@ -77,14 +73,13 @@ public interface ReanalysisResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "OK"), @ApiResponse(responseCode = "409", description = "Conflict")})
|
||||
void ocrFile(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestParam(value = FORCE_PARAM, required = false, defaultValue = FALSE) boolean force,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestParam(value = FORCE_PARAM, required = false, defaultValue = FALSE) boolean force);
|
||||
|
||||
|
||||
@Operation(summary = "Ocr and reanalyze multiple files for a dossier", description = "None")
|
||||
@PostMapping(value = OCR_REANALYSIS_REST_PATH + DOSSIER_ID_PATH_VARIABLE + BULK_REST_PATH)
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "OK")})
|
||||
void ocrFiles(@PathVariable(DOSSIER_ID) String dossierId, @RequestBody Set<String> fileIds, @Parameter(hidden = true) Auditor auditor);
|
||||
void ocrFiles(@PathVariable(DOSSIER_ID) String dossierId, @RequestBody Set<String> fileIds);
|
||||
|
||||
|
||||
@Operation(summary = "Exclude or re-include a file to the automatic analysis", description = "None")
|
||||
@ -92,8 +87,7 @@ public interface ReanalysisResource {
|
||||
@PostMapping(value = TOGGLE_AUTOMATIC_ANALYSIS_PATH + DOSSIER_ID_PATH_VARIABLE + FILE_ID_PATH_VARIABLE)
|
||||
void toggleAutomaticAnalysis(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestParam(EXCLUDED_STATUS_PARAM) boolean excludedFromAutomaticAnalysis,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestParam(EXCLUDED_STATUS_PARAM) boolean excludedFromAutomaticAnalysis);
|
||||
|
||||
|
||||
@Operation(summary = "Exclude or re-include a file to analysis", description = "None")
|
||||
@ -102,8 +96,7 @@ public interface ReanalysisResource {
|
||||
@PostMapping(value = TOGGLE_ANALYSIS_PATH + DOSSIER_ID_PATH_VARIABLE + FILE_ID_PATH_VARIABLE)
|
||||
void toggleExclusion(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestParam(name = EXCLUDED_STATUS_PARAM, required = false, defaultValue = FALSE) boolean excluded,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestParam(name = EXCLUDED_STATUS_PARAM, required = false, defaultValue = FALSE) boolean excluded);
|
||||
|
||||
|
||||
@Operation(summary = "Exclude or re-include a file to the automatic analysis", description = "None")
|
||||
@ -112,8 +105,7 @@ public interface ReanalysisResource {
|
||||
@PostMapping(value = TOGGLE_AUTOMATIC_ANALYSIS_PATH + DOSSIER_ID_PATH_VARIABLE + BULK_REST_PATH)
|
||||
void toggleAutomaticAnalysisForList(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@RequestBody Set<String> fileIds,
|
||||
@RequestParam(EXCLUDED_STATUS_PARAM) boolean excludedFromAutomaticAnalysis,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestParam(EXCLUDED_STATUS_PARAM) boolean excludedFromAutomaticAnalysis);
|
||||
|
||||
|
||||
@Operation(summary = "Exclude or re-include a file to analysis", description = "None")
|
||||
@ -122,21 +114,20 @@ public interface ReanalysisResource {
|
||||
@PostMapping(value = TOGGLE_ANALYSIS_PATH + DOSSIER_ID_PATH_VARIABLE + BULK_REST_PATH)
|
||||
void toggleExclusionForList(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@RequestBody Set<String> fileIds,
|
||||
@RequestParam(name = EXCLUDED_STATUS_PARAM, required = false, defaultValue = FALSE) boolean excluded,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestParam(name = EXCLUDED_STATUS_PARAM, required = false, defaultValue = FALSE) boolean excluded);
|
||||
|
||||
|
||||
@Operation(summary = "Exclude pages from analysis for a file", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "OK")})
|
||||
|
||||
@PostMapping(value = EXCLUDE_PAGES_PATH + DOSSIER_ID_PATH_VARIABLE + FILE_ID_PATH_VARIABLE)
|
||||
void excludePages(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody PageExclusionRequest pageExclusionRequest, @Parameter(hidden = true) Auditor auditor);
|
||||
void excludePages(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody PageExclusionRequest pageExclusionRequest);
|
||||
|
||||
|
||||
@Operation(summary = "Include pages from analysis for a file", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "OK")})
|
||||
@PostMapping(value = INCLUDE_PAGES_PATH + DOSSIER_ID_PATH_VARIABLE + FILE_ID_PATH_VARIABLE)
|
||||
void includePages(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody PageExclusionRequest pageInclusionRequest, @Parameter(hidden = true) Auditor auditor);
|
||||
void includePages(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId, @RequestBody PageExclusionRequest pageInclusionRequest);
|
||||
|
||||
|
||||
@PostMapping(value = REINDEX_REST_PATH)
|
||||
@ -144,6 +135,6 @@ public interface ReanalysisResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "OK")})
|
||||
void reindex(@RequestParam(value = "dossierId", required = false) String dossierId,
|
||||
@RequestParam(value = "dropIndex", required = false, defaultValue = FALSE) boolean dropIndex,
|
||||
@RequestBody List<String> fileIds, @Parameter(hidden = true) Auditor auditor);
|
||||
@RequestBody List<String> fileIds);
|
||||
|
||||
}
|
||||
|
||||
@ -2,8 +2,6 @@ package com.iqser.red.service.persistence.service.v1.api.external.resource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.knecon.fforesight.auditor.Auditor;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@ -55,8 +53,7 @@ public interface ReportTemplateResource {
|
||||
ReportTemplate uploadTemplate(@RequestPart(name = "file") MultipartFile file,
|
||||
@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId,
|
||||
@RequestParam(value = MULTI_FILE_REPORT, required = false, defaultValue = "false") boolean multiFileReport,
|
||||
@RequestParam(value = ACTIVE_BY_DEFAULT, required = false, defaultValue = "false") boolean activeByDefault,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestParam(value = ACTIVE_BY_DEFAULT, required = false, defaultValue = "false") boolean activeByDefault);
|
||||
|
||||
|
||||
@GetMapping(value = REPORT_TEMPLATE_UPLOAD_PATH + DOSSIER_TEMPLATE_ID_PATH_VARIABLE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@ -75,7 +72,7 @@ public interface ReportTemplateResource {
|
||||
@DeleteMapping(value = REPORT_TEMPLATE_UPLOAD_PATH + DOSSIER_TEMPLATE_ID_PATH_VARIABLE + TEMPLATE_ID_PATH_VARIABLE)
|
||||
@Operation(summary = "Delete template file for redaction-report", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "Report template deletion succeeded.")})
|
||||
void deleteTemplate(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @PathVariable(TEMPLATE_ID) String templateId, @Parameter(hidden = true) Auditor auditor);
|
||||
void deleteTemplate(@PathVariable(DOSSIER_TEMPLATE_ID) String dossierTemplateId, @PathVariable(TEMPLATE_ID) String templateId);
|
||||
|
||||
|
||||
@GetMapping(value = PLACEHOLDERS_PATH + DOSSIER_TEMPLATE_ID_PATH_VARIABLE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package com.iqser.red.service.persistence.service.v1.api.external.resource;
|
||||
|
||||
import com.knecon.fforesight.auditor.Auditor;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@ -44,7 +42,7 @@ public interface RulesResource {
|
||||
@PostMapping(value = RULES_PATH, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "Takes object containing string or rules as argument, which will be used by the redaction service.")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "Rules upload successful."), @ApiResponse(responseCode = "400", description = "Uploaded rules could not be verified.")})
|
||||
ResponseEntity<?> upload(@RequestBody RulesUploadRequest rules, @Parameter(hidden = true) Auditor auditor);
|
||||
ResponseEntity<?> upload(@RequestBody RulesUploadRequest rules);
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@ -72,7 +70,7 @@ public interface RulesResource {
|
||||
@PostMapping(value = RULES_PATH + DOSSIER_TEMPLATE_PATH_VARIABLE + UPLOAD_PATH, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
@Operation(summary = "Takes object containing string or rules as argument, which will be used by the redaction service.")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "Rules upload successful."), @ApiResponse(responseCode = "400", description = "Uploaded rules could not be verified.")})
|
||||
ResponseEntity<?> uploadFile(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, @RequestPart(name = "file") MultipartFile file, @Parameter(hidden = true) Auditor auditor);
|
||||
ResponseEntity<?> uploadFile(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId, @RequestPart(name = "file") MultipartFile file);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
@ -81,8 +79,7 @@ public interface RulesResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "Rules upload successful."), @ApiResponse(responseCode = "400", description = "Uploaded rules could not be verified.")})
|
||||
ResponseEntity<?> uploadFile(@PathVariable(DOSSIER_TEMPLATE_PARAMETER_NAME) String dossierTemplateId,
|
||||
@PathVariable(RULE_FILE_TYPE_PARAMETER_NAME) RuleFileType ruleFileType,
|
||||
@RequestPart(name = "file") MultipartFile file,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestPart(name = "file") MultipartFile file);
|
||||
|
||||
|
||||
@ResponseBody
|
||||
|
||||
@ -4,8 +4,6 @@ import java.time.OffsetDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.knecon.fforesight.auditor.Auditor;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -86,8 +84,7 @@ public interface StatusResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Successfully assigned new owner to dossier."), @ApiResponse(responseCode = "404", description = "Not found")})
|
||||
void setCurrentFileAssignee(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestParam(value = ASSIGNEE_ID_REQUEST_PARAM, required = false) String assigneeId,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestParam(value = ASSIGNEE_ID_REQUEST_PARAM, required = false) String assigneeId);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
@ -96,8 +93,7 @@ public interface StatusResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "OK")})
|
||||
void setStatusUnderReview(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestParam(value = ASSIGNEE_ID_REQUEST_PARAM, required = false) String assigneeId,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestParam(value = ASSIGNEE_ID_REQUEST_PARAM, required = false) String assigneeId);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
@ -106,16 +102,14 @@ public interface StatusResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "OK")})
|
||||
void setStatusUnderApproval(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestParam(value = ASSIGNEE_ID_REQUEST_PARAM, required = false) String assigneeId,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestParam(value = ASSIGNEE_ID_REQUEST_PARAM, required = false) String assigneeId);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
@PostMapping(value = STATUS_REST_PATH + "/approved" + DOSSIER_ID_PATH_VARIABLE + FILE_ID_PATH_VARIABLE)
|
||||
@Operation(summary = "Sets the status APPROVED for a file.", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "OK")})
|
||||
void setStatusApproved(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
void setStatusApproved(@PathVariable(DOSSIER_ID) String dossierId, @PathVariable(FILE_ID) String fileId);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
@ -124,8 +118,7 @@ public interface StatusResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Successfully assigned new owner to dossier."), @ApiResponse(responseCode = "404", description = "Not found")})
|
||||
void setAssigneeForList(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@RequestParam(value = ASSIGNEE_ID_REQUEST_PARAM, required = false) String assigneeId,
|
||||
@RequestBody List<String> fileIds,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestBody List<String> fileIds);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
@ -134,8 +127,7 @@ public interface StatusResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "OK")})
|
||||
void setStatusUnderReviewForList(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@RequestBody List<String> fileIds,
|
||||
@RequestParam(value = ASSIGNEE_ID_REQUEST_PARAM, required = false) String assigneeId,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestParam(value = ASSIGNEE_ID_REQUEST_PARAM, required = false) String assigneeId);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
@ -144,15 +136,14 @@ public interface StatusResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "OK")})
|
||||
void setStatusUnderApprovalForList(@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@RequestBody List<String> fileIds,
|
||||
@RequestParam(value = ASSIGNEE_ID_REQUEST_PARAM, required = false) String assigneeId,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestParam(value = ASSIGNEE_ID_REQUEST_PARAM, required = false) String assigneeId);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
@PostMapping(value = STATUS_REST_PATH + "/approved" + DOSSIER_ID_PATH_VARIABLE + BULK_REST_PATH, consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
@Operation(summary = "Sets the status APPROVED for a list of files.", description = "None")
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "204", description = "OK")})
|
||||
void setStatusApprovedForList(@PathVariable(DOSSIER_ID) String dossierId, @RequestBody List<String> fileIds, @Parameter(hidden = true) Auditor auditor);
|
||||
void setStatusApprovedForList(@PathVariable(DOSSIER_ID) String dossierId, @RequestBody List<String> fileIds);
|
||||
|
||||
|
||||
@ResponseStatus(value = HttpStatus.NO_CONTENT)
|
||||
|
||||
@ -2,8 +2,6 @@ package com.iqser.red.service.persistence.service.v1.api.external.resource;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import com.knecon.fforesight.auditor.Auditor;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@ -48,7 +46,6 @@ public interface UploadResource {
|
||||
void importRedactions(@RequestPart(name = "file") MultipartFile file,
|
||||
@PathVariable(DOSSIER_ID) String dossierId,
|
||||
@PathVariable(FILE_ID) String fileId,
|
||||
@RequestParam(value = "pageInclusionRequest", required = false) Set<Integer> pageInclusionRequest,
|
||||
@Parameter(hidden = true) Auditor auditor);
|
||||
@RequestParam(value = "pageInclusionRequest", required = false) Set<Integer> pageInclusionRequest);
|
||||
|
||||
}
|
||||
|
||||
@ -2,8 +2,6 @@ package com.iqser.red.service.persistence.service.v1.api.external.resource;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.knecon.fforesight.auditor.Auditor;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
@ -35,7 +33,7 @@ public interface WatermarkResource {
|
||||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "400", description = "Invalid Watermark Data."), @ApiResponse(responseCode = "403", description = "Forbidden.")})
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
@PostMapping(value = WATERMARK_PATH, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
WatermarkModel saveWatermark(@RequestBody WatermarkModel watermark, @Parameter(hidden = true) Auditor auditor);
|
||||
WatermarkModel saveWatermark(@RequestBody WatermarkModel watermark);
|
||||
|
||||
|
||||
@Operation(summary = "Get a specific watermark configuration", description = "None")
|
||||
@ -56,7 +54,7 @@ public interface WatermarkResource {
|
||||
|
||||
@ResponseStatus(HttpStatus.NO_CONTENT)
|
||||
@DeleteMapping(value = WATERMARK_PATH + WATERMARK_ID_PATH_VARIABLE)
|
||||
void deleteWatermark(@PathVariable(WATERMARK_ID_PARAMETER_NAME) long watermarkId, @Parameter(hidden = true) Auditor auditor);
|
||||
void deleteWatermark(@PathVariable(WATERMARK_ID_PARAMETER_NAME) long watermarkId);
|
||||
|
||||
|
||||
@Operation(summary = "Check if a specific watermark configuration is in use", description = "None")
|
||||
|
||||
@ -72,7 +72,7 @@ public class DossierTemplateTesterAndProvider {
|
||||
cru.setValidTo(OffsetDateTime.now().plusHours(1).truncatedTo(ChronoUnit.MILLIS));
|
||||
cru.setOcrByDefault(ocrByDefault);
|
||||
|
||||
var result = dossierTemplateClient.createOrUpdateDossierTemplate(cru, auditor);
|
||||
var result = dossierTemplateClient.createOrUpdateDossierTemplate(cru);
|
||||
|
||||
assertThat(result.getName()).isEqualTo(name);
|
||||
|
||||
@ -80,10 +80,10 @@ public class DossierTemplateTesterAndProvider {
|
||||
|
||||
assertThat(loadedTemplate).isEqualTo(result);
|
||||
|
||||
rulesClient.upload(new RulesUploadRequest("ABCD", loadedTemplate.getDossierTemplateId()), auditor);
|
||||
rulesClient.upload(new RulesUploadRequest("ABCD", loadedTemplate.getDossierTemplateId()));
|
||||
legalBasisClient.setLegalBasisMapping(
|
||||
List.of(new LegalBasis("name", "description", "reason")),
|
||||
loadedTemplate.getDossierTemplateId(), auditor);
|
||||
loadedTemplate.getDossierTemplateId());
|
||||
|
||||
loadedTemplate = dossierTemplateClient.getDossierTemplate(result.getDossierTemplateId());
|
||||
|
||||
|
||||
@ -31,9 +31,6 @@ public class DossierTesterAndProvider {
|
||||
@Autowired
|
||||
private UserProvider userProvider;
|
||||
|
||||
@Autowired
|
||||
private TestAuditor auditor;
|
||||
|
||||
public Dossier provideTestDossier(DossierTemplateModel testTemplate) {
|
||||
|
||||
return provideTestDossier(testTemplate, "Dossier1");
|
||||
@ -82,7 +79,7 @@ public class DossierTesterAndProvider {
|
||||
cru.setMemberIds(Sets.newHashSet(userId, altUserId));
|
||||
cru.setApproverIds(Sets.newHashSet(userId, altUserId));
|
||||
|
||||
var result = dossierClient.createDossierOrUpdateDossier(cru, auditor);
|
||||
var result = dossierClient.createDossierOrUpdateDossier(cru);
|
||||
|
||||
return result.getBody();
|
||||
}
|
||||
|
||||
@ -2,7 +2,6 @@ package com.iqser.red.service.peristence.v1.server.integration.service;
|
||||
|
||||
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -16,9 +15,6 @@ public class ReportTemplateProvider {
|
||||
@Autowired
|
||||
private ReportTemplateClient reportTemplateClient;
|
||||
|
||||
@Autowired
|
||||
private TestAuditor auditor;
|
||||
|
||||
|
||||
public ReportTemplate provideReportTemplate(String dossierTemplateId) {
|
||||
|
||||
@ -35,7 +31,7 @@ public class ReportTemplateProvider {
|
||||
public ReportTemplate provideReportTemplate(String dossierTemplateId, String name, byte[] content, boolean multiFile, boolean activeByDefault) {
|
||||
|
||||
var template = new MockMultipartFile(name,name,"application/octet-stream", content);
|
||||
reportTemplateClient.uploadTemplate(template, dossierTemplateId, multiFile, activeByDefault, auditor);
|
||||
reportTemplateClient.uploadTemplate(template, dossierTemplateId, multiFile, activeByDefault);
|
||||
|
||||
var tpl = reportTemplateClient.getAvailableReportTemplates(dossierTemplateId)
|
||||
.stream()
|
||||
|
||||
@ -17,9 +17,6 @@ public class TypeProvider {
|
||||
@Autowired
|
||||
private DictionaryClient dictionaryClient;
|
||||
|
||||
@Autowired
|
||||
private TestAuditor auditor;
|
||||
|
||||
|
||||
public TypeValue testAndProvideType(DossierTemplateModel dossierTemplate) {
|
||||
|
||||
@ -56,7 +53,7 @@ public class TypeProvider {
|
||||
type.setHasDictionary(true);
|
||||
type.setDossierDictionaryOnly(dossierDictionaryOnly);
|
||||
|
||||
dictionaryClient.addType(type, auditor);
|
||||
dictionaryClient.addType(type);
|
||||
var allTypes = dictionaryClient.getAllTypes(dossierTemplate.getDossierTemplateId(), dossier != null ? dossier.getId() : null, false);
|
||||
|
||||
var foundType = allTypes.getTypes().stream().filter(t -> t.getType().equalsIgnoreCase(typeName)).findAny();
|
||||
|
||||
@ -63,13 +63,11 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
var falsePositives = List.of("false_positive1", "false_positive");
|
||||
var falseRecommendations = List.of("false_recommendation1", "false_recommendation2");
|
||||
Assertions.assertThrows(FeignException.Forbidden.class, () -> dictionaryClient.addEntry(type.getType(),
|
||||
type.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY, auditor));
|
||||
type.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY));
|
||||
Assertions.assertThrows(FeignException.Forbidden.class, () -> dictionaryClient.addEntry(type.getType(),
|
||||
type.getDossierTemplateId(), falsePositives, false, null, DictionaryEntryType.FALSE_POSITIVE,
|
||||
auditor));
|
||||
type.getDossierTemplateId(), falsePositives, false, null, DictionaryEntryType.FALSE_POSITIVE));
|
||||
Assertions.assertThrows(FeignException.Forbidden.class, () -> dictionaryClient.addEntry(type.getType(),
|
||||
type.getDossierTemplateId(), falseRecommendations, false, null, DictionaryEntryType.FALSE_RECOMMENDATION,
|
||||
auditor));
|
||||
type.getDossierTemplateId(), falseRecommendations, false, null, DictionaryEntryType.FALSE_RECOMMENDATION));
|
||||
|
||||
var loadedType1 = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
assertThat(loadedType1).isNotNull();
|
||||
@ -78,20 +76,17 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(loadedType1.getFalseRecommendationEntries()).isEmpty();
|
||||
|
||||
Assertions.assertThrows(FeignException.Forbidden.class, () -> dictionaryClient.deleteEntries(type.getType(),
|
||||
type.getDossierTemplateId(), entries, null, DictionaryEntryType.ENTRY, auditor));
|
||||
type.getDossierTemplateId(), entries, null, DictionaryEntryType.ENTRY));
|
||||
Assertions.assertThrows(FeignException.Forbidden.class, () -> dictionaryClient.deleteEntries(type.getType(),
|
||||
type.getDossierTemplateId(), falsePositives, null, DictionaryEntryType.FALSE_POSITIVE, auditor));
|
||||
type.getDossierTemplateId(), falsePositives, null, DictionaryEntryType.FALSE_POSITIVE));
|
||||
Assertions.assertThrows(FeignException.Forbidden.class, () -> dictionaryClient.deleteEntries(type.getType(),
|
||||
type.getDossierTemplateId(), falseRecommendations, null, DictionaryEntryType.FALSE_RECOMMENDATION,
|
||||
auditor));
|
||||
type.getDossierTemplateId(), falseRecommendations, null, DictionaryEntryType.FALSE_RECOMMENDATION));
|
||||
Assertions.assertThrows(FeignException.Forbidden.class, () -> dictionaryClient.deleteEntry(type.getType(),
|
||||
type.getDossierTemplateId(), entries.get(0), null, DictionaryEntryType.ENTRY, auditor));
|
||||
type.getDossierTemplateId(), entries.get(0), null, DictionaryEntryType.ENTRY));
|
||||
Assertions.assertThrows(FeignException.Forbidden.class, () -> dictionaryClient.deleteEntry(type.getType(),
|
||||
type.getDossierTemplateId(), falsePositives.get(0), null, DictionaryEntryType.FALSE_POSITIVE,
|
||||
auditor));
|
||||
type.getDossierTemplateId(), falsePositives.get(0), null, DictionaryEntryType.FALSE_POSITIVE));
|
||||
Assertions.assertThrows(FeignException.Forbidden.class, () -> dictionaryClient.deleteEntry(type.getType(),
|
||||
type.getDossierTemplateId(), falseRecommendations.get(0), null, DictionaryEntryType.FALSE_RECOMMENDATION,
|
||||
auditor));
|
||||
type.getDossierTemplateId(), falseRecommendations.get(0), null, DictionaryEntryType.FALSE_RECOMMENDATION));
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -104,16 +99,15 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(type.isDossierDictionaryOnly()).isFalse();
|
||||
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("word1", "word2"), false,
|
||||
null, DictionaryEntryType.ENTRY, auditor);
|
||||
null, DictionaryEntryType.ENTRY);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("false_positive1", "false_positive"),
|
||||
false, null, DictionaryEntryType.FALSE_POSITIVE, auditor);
|
||||
false, null, DictionaryEntryType.FALSE_POSITIVE);
|
||||
dictionaryClient.addEntry(type.getType(),
|
||||
type.getDossierTemplateId(),
|
||||
List.of("false_recommendation1", "false_recommendation2"),
|
||||
false,
|
||||
null,
|
||||
DictionaryEntryType.FALSE_RECOMMENDATION,
|
||||
auditor);
|
||||
DictionaryEntryType.FALSE_RECOMMENDATION);
|
||||
|
||||
var loadedType1 = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
|
||||
@ -135,7 +129,7 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
var request = new UpdateTypeValue();
|
||||
BeanUtils.copyProperties(type, request);
|
||||
type.setSkippedHexColor(null);
|
||||
dictionaryClient.updateType(type.getType(), type.getDossierTemplateId(), request, auditor);
|
||||
dictionaryClient.updateType(type.getType(), type.getDossierTemplateId(), request);
|
||||
|
||||
var loadedType = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
assertThat(loadedType.getSkippedHexColor()).isNotNull();
|
||||
@ -152,7 +146,7 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
entries.add("age");
|
||||
entries.add("page");
|
||||
try {
|
||||
dictionaryClient.addEntry(typeId, dossier.getDossierTemplateId(), entries, false, dossier.getId(), DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(typeId, dossier.getDossierTemplateId(), entries, false, dossier.getId(), DictionaryEntryType.ENTRY);
|
||||
} catch (FeignException e) {
|
||||
assertThat(e.status()).isEqualTo(400);
|
||||
}
|
||||
@ -171,34 +165,34 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
entries.add("p");
|
||||
|
||||
try {
|
||||
dictionaryClient.addEntry(type, dossier.getDossierTemplateId(), entries, false, dossier.getId(), DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type, dossier.getDossierTemplateId(), entries, false, dossier.getId(), DictionaryEntryType.ENTRY);
|
||||
} catch (FeignException e) {
|
||||
assertThat(e.status()).isEqualTo(400);
|
||||
}
|
||||
entries.remove(1);
|
||||
entries.add("5");
|
||||
try {
|
||||
dictionaryClient.addEntry(type, dossier.getDossierTemplateId(), entries, false, dossier.getId(), DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type, dossier.getDossierTemplateId(), entries, false, dossier.getId(), DictionaryEntryType.ENTRY);
|
||||
} catch (FeignException e) {
|
||||
assertThat(e.status()).isEqualTo(400);
|
||||
}
|
||||
entries.remove(1);
|
||||
entries.add("12");
|
||||
try {
|
||||
dictionaryClient.addEntry(type, dossier.getDossierTemplateId(), entries, false, dossier.getId(), DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type, dossier.getDossierTemplateId(), entries, false, dossier.getId(), DictionaryEntryType.ENTRY);
|
||||
} catch (FeignException e) {
|
||||
assertThat(e.status()).isEqualTo(400);
|
||||
}
|
||||
entries.remove(1);
|
||||
entries.add(";");
|
||||
try {
|
||||
dictionaryClient.addEntry(type, dossier.getDossierTemplateId(), entries, false, dossier.getId(), DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type, dossier.getDossierTemplateId(), entries, false, dossier.getId(), DictionaryEntryType.ENTRY);
|
||||
} catch (FeignException e) {
|
||||
assertThat(e.status()).isEqualTo(400);
|
||||
}
|
||||
entries.remove(1);
|
||||
entries.add("設");
|
||||
dictionaryClient.addEntry(type, dossier.getDossierTemplateId(), entries, false, dossier.getId(), DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type, dossier.getDossierTemplateId(), entries, false, dossier.getId(), DictionaryEntryType.ENTRY);
|
||||
}
|
||||
|
||||
|
||||
@ -214,7 +208,7 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
var entries = new ArrayList<String>();
|
||||
entries.add(word);
|
||||
entries.add(word);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY);
|
||||
|
||||
var dictionary = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
|
||||
@ -224,7 +218,7 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
// Act & Assert: Add same word again; Only one should exist
|
||||
entries = new ArrayList<>();
|
||||
entries.add(word);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY);
|
||||
|
||||
dictionary = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
assertThat(dictionary.getEntries()).hasSize(1);
|
||||
@ -236,7 +230,7 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
entries.add(word);
|
||||
entries.add(word);
|
||||
entries.add(word);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY);
|
||||
|
||||
dictionary = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
assertThat(dictionary.getEntries()).hasSize(1);
|
||||
@ -246,7 +240,7 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
// Act & Assert: Delete word; Should have 'deleted' flag
|
||||
entries = new ArrayList<>();
|
||||
entries.add(word);
|
||||
dictionaryClient.deleteEntries(type.getType(), type.getDossierTemplateId(), entries, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.deleteEntries(type.getType(), type.getDossierTemplateId(), entries, null, DictionaryEntryType.ENTRY);
|
||||
|
||||
dictionary = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
assertThat(dictionary.getEntries()).hasSize(0);
|
||||
@ -268,7 +262,7 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
entries.add(word1);
|
||||
entries.add(word2);
|
||||
entries.add(word3);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY);
|
||||
|
||||
var dictionary = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
|
||||
@ -278,7 +272,7 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
// Act & Assert: Add same word again; No duplicate should exist
|
||||
entries = new ArrayList<>();
|
||||
entries.add(word1);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY);
|
||||
|
||||
dictionary = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
|
||||
@ -293,7 +287,7 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
entries.add(word1);
|
||||
entries.add(word2);
|
||||
entries.add(word3);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY);
|
||||
|
||||
dictionary = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
|
||||
@ -322,7 +316,7 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
.addToDictionaryAction(false)
|
||||
.dossierTemplateId(dossier.getDossierTemplateId())
|
||||
.dossierDictionaryOnly(true)
|
||||
.build(), auditor);
|
||||
.build());
|
||||
assertThat(returnedtype1.isDossierDictionaryOnly()).isTrue();
|
||||
|
||||
assertThat(dictionaryClient.getAllTypes(dossier.getDossierTemplateId(), null, false).getTypes().size()).isEqualTo(1);
|
||||
@ -348,7 +342,7 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
.dossierTemplateId(dossierTemplate.getId())
|
||||
.build();
|
||||
|
||||
var createdType = dictionaryClient.addType(type, auditor);
|
||||
var createdType = dictionaryClient.addType(type);
|
||||
|
||||
var word1 = "Luke Skywalker";
|
||||
var word2 = "Anakin Skywalker";
|
||||
@ -359,7 +353,7 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
entries.add(word1);
|
||||
entries.add(word2);
|
||||
entries.add(word3);
|
||||
dictionaryClient.addEntry(createdType.getType(), createdType.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(createdType.getType(), createdType.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY);
|
||||
|
||||
var dictionary = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
|
||||
@ -367,10 +361,10 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(actualEntries.size()).isEqualTo(3);
|
||||
assertThat(actualEntries).usingComparator(new ListContentWithoutOrderAndWithoutDuplicatesComparator<>()).isEqualTo(entries);
|
||||
|
||||
dictionaryClient.deleteType(createdType.getType(), createdType.getDossierTemplateId(), auditor);
|
||||
dictionaryClient.deleteType(createdType.getType(), createdType.getDossierTemplateId());
|
||||
assertThat(dictionaryClient.getAllTypes(createdType.getDossierTemplateId(), null, false).getTypes().size()).isEqualTo(0);
|
||||
|
||||
dictionaryClient.addType(type, auditor);
|
||||
dictionaryClient.addType(type);
|
||||
|
||||
dictionary = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
|
||||
@ -395,19 +389,19 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
entries.add(word1);
|
||||
entries.add(word2);
|
||||
entries.add(word3);
|
||||
dictionaryClient.addEntry(createdType.getType(), createdType.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(createdType.getType(), createdType.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY);
|
||||
|
||||
var word4 = "Padme";
|
||||
var word5 = "Obiwan";
|
||||
entries.clear();
|
||||
entries.add(word4);
|
||||
entries.add(word5);
|
||||
dictionaryClient.addEntry(createdType.getType(), createdType.getDossierTemplateId(), entries, true, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(createdType.getType(), createdType.getDossierTemplateId(), entries, true, null, DictionaryEntryType.ENTRY);
|
||||
|
||||
entries.add(word1);
|
||||
entries.add(word2);
|
||||
entries.add(word3);
|
||||
dictionaryClient.addEntry(createdType.getType(), createdType.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(createdType.getType(), createdType.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY);
|
||||
|
||||
var dictionary = dictionaryClient.getDictionaryForType(createdType.getType(), createdType.getDossierTemplateId(), null);
|
||||
|
||||
@ -437,14 +431,14 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(type.getSkippedHexColor()).isEqualTo("#aaaaaa");
|
||||
assertThat(type.isDossierDictionaryOnly()).isFalse();
|
||||
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("word1", "word2", "word3"), false, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("false_positive1", "false_positive"), false, null, DictionaryEntryType.FALSE_POSITIVE, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("word1", "word2", "word3"), false, null, DictionaryEntryType.ENTRY);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("false_positive1", "false_positive"), false, null, DictionaryEntryType.FALSE_POSITIVE);
|
||||
dictionaryClient.addEntry(type.getType(),
|
||||
type.getDossierTemplateId(),
|
||||
List.of("false_recommendation1", "false_recommendation2"),
|
||||
false,
|
||||
null,
|
||||
DictionaryEntryType.FALSE_RECOMMENDATION, auditor);
|
||||
DictionaryEntryType.FALSE_RECOMMENDATION);
|
||||
|
||||
var loadedType1 = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
|
||||
@ -452,15 +446,15 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(loadedType1.getFalsePositiveEntries()).hasSize(2);
|
||||
assertThat(loadedType1.getFalseRecommendationEntries()).hasSize(2);
|
||||
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("word1", "word4"), false, dossier.getDossierId(), DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.deleteEntries(type.getType(), type.getDossierTemplateId(), List.of("word2"), dossier.getDossierId(), DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("false_positive1", "false_positive3"), false, dossier.getDossierId(), DictionaryEntryType.FALSE_POSITIVE, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("word1", "word4"), false, dossier.getDossierId(), DictionaryEntryType.ENTRY);
|
||||
dictionaryClient.deleteEntries(type.getType(), type.getDossierTemplateId(), List.of("word2"), dossier.getDossierId(), DictionaryEntryType.ENTRY);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("false_positive1", "false_positive3"), false, dossier.getDossierId(), DictionaryEntryType.FALSE_POSITIVE);
|
||||
dictionaryClient.addEntry(type.getType(),
|
||||
type.getDossierTemplateId(),
|
||||
List.of("false_recommendation3", "false_recommendation4"),
|
||||
false,
|
||||
dossier.getDossierId(),
|
||||
DictionaryEntryType.FALSE_RECOMMENDATION, auditor);
|
||||
DictionaryEntryType.FALSE_RECOMMENDATION);
|
||||
Assertions.assertThrows(FeignException.Unauthorized.class, () -> dictionaryClient.getMergedDictionaries(type.getType() + ";", dossierTemplate.getDossierTemplateId(), dossier.getDossierId()));
|
||||
|
||||
Dictionary mergedDict = dictionaryClient.getMergedDictionaries(type.getType(), dossierTemplate.getDossierTemplateId(), dossier.getDossierId());
|
||||
@ -477,14 +471,14 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
var dossier = dossierTesterAndProvider.provideTestDossier(dossierTemplate, "Dossier");
|
||||
var type = typeProvider.testAndProvideType(dossierTemplate);
|
||||
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("word1", "word2", "word3"), false, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("false_positive1", "false_positive"), false, null, DictionaryEntryType.FALSE_POSITIVE, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("word1", "word2", "word3"), false, null, DictionaryEntryType.ENTRY);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("false_positive1", "false_positive"), false, null, DictionaryEntryType.FALSE_POSITIVE);
|
||||
dictionaryClient.addEntry(type.getType(),
|
||||
type.getDossierTemplateId(),
|
||||
List.of("false_recommendation1", "false_recommendation2"),
|
||||
false,
|
||||
null,
|
||||
DictionaryEntryType.FALSE_RECOMMENDATION, auditor);
|
||||
DictionaryEntryType.FALSE_RECOMMENDATION);
|
||||
|
||||
var loadedType1 = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
|
||||
@ -492,15 +486,15 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(loadedType1.getFalsePositiveEntries()).hasSize(2);
|
||||
assertThat(loadedType1.getFalseRecommendationEntries()).hasSize(2);
|
||||
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("word1", "word4"), false, dossier.getDossierId(), DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.deleteEntries(type.getType(), type.getDossierTemplateId(), List.of("word2"), dossier.getDossierId(), DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("false_positive1", "false_positive3"), false, dossier.getDossierId(), DictionaryEntryType.FALSE_POSITIVE, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("word1", "word4"), false, dossier.getDossierId(), DictionaryEntryType.ENTRY);
|
||||
dictionaryClient.deleteEntries(type.getType(), type.getDossierTemplateId(), List.of("word2"), dossier.getDossierId(), DictionaryEntryType.ENTRY);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("false_positive1", "false_positive3"), false, dossier.getDossierId(), DictionaryEntryType.FALSE_POSITIVE);
|
||||
dictionaryClient.addEntry(type.getType(),
|
||||
type.getDossierTemplateId(),
|
||||
List.of("false_recommendation3", "false_recommendation4"),
|
||||
false,
|
||||
dossier.getDossierId(),
|
||||
DictionaryEntryType.FALSE_RECOMMENDATION, auditor);
|
||||
DictionaryEntryType.FALSE_RECOMMENDATION);
|
||||
|
||||
var loadedType2 = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), dossier.getDossierId());
|
||||
|
||||
@ -522,14 +516,14 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(type.getSkippedHexColor()).isEqualTo("#aaaaaa");
|
||||
assertThat(type.isDossierDictionaryOnly()).isFalse();
|
||||
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("Charalampos", "Carina Wilson", "carlsen"), false, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("false_positive1", "false_positive"), false, null, DictionaryEntryType.FALSE_POSITIVE, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("Charalampos", "Carina Wilson", "carlsen"), false, null, DictionaryEntryType.ENTRY);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("false_positive1", "false_positive"), false, null, DictionaryEntryType.FALSE_POSITIVE);
|
||||
dictionaryClient.addEntry(type.getType(),
|
||||
type.getDossierTemplateId(),
|
||||
List.of("false_recommendation1", "afalse_recommendation2"),
|
||||
false,
|
||||
null,
|
||||
DictionaryEntryType.FALSE_RECOMMENDATION, auditor);
|
||||
DictionaryEntryType.FALSE_RECOMMENDATION);
|
||||
|
||||
var loadedType1 = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
|
||||
@ -564,11 +558,11 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
.dossierTemplateId(dossierTemplate.getId())
|
||||
.build();
|
||||
|
||||
var createdType = dictionaryClient.addType(type, auditor);
|
||||
var createdType = dictionaryClient.addType(type);
|
||||
|
||||
var entries = createDummyEntries(10_000);
|
||||
|
||||
dictionaryClient.addEntry(createdType.getType(), createdType.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(createdType.getType(), createdType.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY);
|
||||
|
||||
var dictionary = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
|
||||
@ -576,7 +570,7 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(actualEntries.size()).isEqualTo(entries.size());
|
||||
assertThat(actualEntries).usingComparator(new ListContentWithoutOrderAndWithoutDuplicatesComparator<>()).isEqualTo(entries);
|
||||
|
||||
dictionaryClient.deleteEntries(type.getType(), dossierTemplate.getDossierTemplateId(), entries, null, null, auditor);
|
||||
dictionaryClient.deleteEntries(type.getType(), dossierTemplate.getDossierTemplateId(), entries, null, null);
|
||||
|
||||
dictionary = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
|
||||
@ -615,7 +609,7 @@ public class DictionaryTest extends AbstractPersistenceServerServiceTest {
|
||||
.dossierTemplateId(dossierTemplateId)
|
||||
.hexColor("#FFFFFF")
|
||||
.recommendationHexColor("#FFFFFF")
|
||||
.build(), auditor);
|
||||
.build());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,6 @@ package com.iqser.red.service.peristence.v1.server.integration.tests;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
@ -43,7 +42,7 @@ public class DigitalSignatureTest extends AbstractPersistenceServerServiceTest {
|
||||
digitalSignature.setContactInfo("test");
|
||||
digitalSignature.setBase64EncodedPrivateKey("zzz");
|
||||
|
||||
var savedDigitalSignature = digitalSignatureClient.saveDigitalSignature(digitalSignature, auditor);
|
||||
var savedDigitalSignature = digitalSignatureClient.saveDigitalSignature(digitalSignature);
|
||||
|
||||
var loadedSignature = digitalSignatureClient.getDigitalSignature();
|
||||
// encrypted
|
||||
@ -51,11 +50,11 @@ public class DigitalSignatureTest extends AbstractPersistenceServerServiceTest {
|
||||
var dvm = new DigitalSignatureViewModel();
|
||||
BeanUtils.copyProperties(loadedSignature, dvm);
|
||||
dvm.setReason("new test");
|
||||
digitalSignatureClient.updateDigitalSignature(dvm, auditor);
|
||||
digitalSignatureClient.updateDigitalSignature(dvm);
|
||||
loadedSignature = digitalSignatureClient.getDigitalSignature();
|
||||
assertThat(loadedSignature.getReason()).isEqualTo("new test");
|
||||
|
||||
digitalSignatureClient.deleteDigitalSignature(auditor);
|
||||
digitalSignatureClient.deleteDigitalSignature();
|
||||
try {
|
||||
digitalSignatureClient.getDigitalSignature();
|
||||
} catch (FeignException.FeignClientException e) {
|
||||
@ -102,7 +101,7 @@ public class DigitalSignatureTest extends AbstractPersistenceServerServiceTest {
|
||||
}
|
||||
|
||||
// Act and Assert: Save
|
||||
var savedDigitalSignature = digitalSignatureClient.saveDigitalSignatureKms(digitalSignature, auditor);
|
||||
var savedDigitalSignature = digitalSignatureClient.saveDigitalSignatureKms(digitalSignature);
|
||||
|
||||
assertThat(savedDigitalSignature.getKmsAccessKey()).isEqualTo(digitalSignature.getKmsAccessKey());
|
||||
assertThat(savedDigitalSignature.getKmsKeyId()).isEqualTo(digitalSignature.getKmsKeyId());
|
||||
@ -120,7 +119,7 @@ public class DigitalSignatureTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(loadedDigitalSignature.getKmsServiceEndpoint()).isEqualTo(digitalSignature.getKmsServiceEndpoint());
|
||||
|
||||
// Act and Assert: Delete
|
||||
digitalSignatureClient.deleteDigitalSignatureKms(auditor);
|
||||
digitalSignatureClient.deleteDigitalSignatureKms();
|
||||
try {
|
||||
digitalSignatureClient.getDigitalSignatureKms();
|
||||
} catch (FeignException.FeignClientException e) {
|
||||
|
||||
@ -48,21 +48,21 @@ public class DossierAttributeTest extends AbstractPersistenceServerServiceTest {
|
||||
attribute.setEditable(true);
|
||||
attribute.setType(DossierAttributeType.TEXT);
|
||||
|
||||
dossierAttributeConfigClient.addOrUpdateDossierAttributeConfig(dossier.getDossierTemplateId(), attribute, auditor);
|
||||
dossierAttributeConfigClient.addOrUpdateDossierAttributeConfig(dossier.getDossierTemplateId(), attribute);
|
||||
loadedAttributes = dossierAttributeConfigClient.getDossierAttributesConfig(dossier.getDossierTemplateId());
|
||||
assertThat(loadedAttributes.getDossierAttributeConfigs()).isNotEmpty();
|
||||
|
||||
dossierAttributeConfigClient.setDossierAttributesConfig(dossier.getDossierTemplateId(), new DossierAttributesConfig(), auditor);
|
||||
dossierAttributeConfigClient.setDossierAttributesConfig(dossier.getDossierTemplateId(), new DossierAttributesConfig());
|
||||
loadedAttributes = dossierAttributeConfigClient.getDossierAttributesConfig(dossier.getDossierTemplateId());
|
||||
assertThat(loadedAttributes.getDossierAttributeConfigs()).isEmpty();
|
||||
|
||||
dossierAttributeConfigClient.setDossierAttributesConfig(dossier.getDossierTemplateId(), new DossierAttributesConfig(List.of(attribute)), auditor);
|
||||
dossierAttributeConfigClient.setDossierAttributesConfig(dossier.getDossierTemplateId(), new DossierAttributesConfig(List.of(attribute)));
|
||||
loadedAttributes = dossierAttributeConfigClient.getDossierAttributesConfig(dossier.getDossierTemplateId());
|
||||
assertThat(loadedAttributes.getDossierAttributeConfigs()).isNotEmpty();
|
||||
|
||||
dossierAttributeConfigClient.deleteDossierAttributesConfig(dossier.getDossierTemplateId(),
|
||||
loadedAttributes.getDossierAttributeConfigs().stream().map(DossierAttributeConfig::getId).collect(Collectors.toList()), auditor);
|
||||
dossierAttributeConfigClient.setDossierAttributesConfig(dossier.getDossierTemplateId(), new DossierAttributesConfig(List.of(attribute)), auditor);
|
||||
loadedAttributes.getDossierAttributeConfigs().stream().map(DossierAttributeConfig::getId).collect(Collectors.toList()));
|
||||
dossierAttributeConfigClient.setDossierAttributesConfig(dossier.getDossierTemplateId(), new DossierAttributesConfig(List.of(attribute)));
|
||||
loadedAttributes = dossierAttributeConfigClient.getDossierAttributesConfig(dossier.getDossierTemplateId());
|
||||
assertThat(loadedAttributes.getDossierAttributeConfigs()).isNotEmpty();
|
||||
|
||||
@ -70,44 +70,44 @@ public class DossierAttributeTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
List<DossierAttribute> dossierAttributes = new ArrayList<>();
|
||||
dossierAttributes.add(DossierAttribute.builder().dossierAttributeConfigId(configId).dossierId(dossier.getId()).value("lorem ipsum").build());
|
||||
dossierAttributeClient.setDossierAttributes(dossier.getId(), new DossierAttributes(dossierAttributes), auditor);
|
||||
dossierAttributeClient.setDossierAttributes(dossier.getId(), new DossierAttributes(dossierAttributes));
|
||||
|
||||
var loadedAttributeValues = dossierAttributeClient.getDossierAttributes(dossier.getId(), auditor);
|
||||
var loadedAttributeValues = dossierAttributeClient.getDossierAttributes(dossier.getId());
|
||||
assertThat(loadedAttributeValues.getDossierAttributeList()).isNotEmpty();
|
||||
|
||||
var firstAttribute = loadedAttributeValues.getDossierAttributeList().iterator().next();
|
||||
assertThat(firstAttribute.getValue()).isEqualTo("lorem ipsum");
|
||||
|
||||
firstAttribute.setValue(" ");
|
||||
dossierAttributeClient.addOrUpdateDossierAttribute(dossier.getId(), firstAttribute, auditor);
|
||||
dossierAttributeClient.addOrUpdateDossierAttribute(dossier.getId(), firstAttribute);
|
||||
|
||||
loadedAttributeValues = dossierAttributeClient.getDossierAttributes(dossier.getId(), auditor);
|
||||
loadedAttributeValues = dossierAttributeClient.getDossierAttributes(dossier.getId());
|
||||
assertThat(loadedAttributeValues.getDossierAttributeList()).isNotEmpty();
|
||||
firstAttribute = loadedAttributeValues.getDossierAttributeList().iterator().next();
|
||||
assertThat(firstAttribute.getValue()).isNull();
|
||||
|
||||
firstAttribute.setValue(null);
|
||||
dossierAttributeClient.addOrUpdateDossierAttribute(dossier.getId(), firstAttribute, auditor);
|
||||
dossierAttributeClient.addOrUpdateDossierAttribute(dossier.getId(), firstAttribute);
|
||||
|
||||
loadedAttributeValues = dossierAttributeClient.getDossierAttributes(dossier.getId(), auditor);
|
||||
loadedAttributeValues = dossierAttributeClient.getDossierAttributes(dossier.getId());
|
||||
assertThat(loadedAttributeValues.getDossierAttributeList()).isNotEmpty();
|
||||
firstAttribute = loadedAttributeValues.getDossierAttributeList().iterator().next();
|
||||
assertThat(firstAttribute.getValue()).isNull();
|
||||
|
||||
dossierAttributeClient.deleteDossierAttribute(dossier.getId(), firstAttribute.getDossierAttributeConfigId(), auditor);
|
||||
loadedAttributeValues = dossierAttributeClient.getDossierAttributes(dossier.getId(), auditor);
|
||||
dossierAttributeClient.deleteDossierAttribute(dossier.getId(), firstAttribute.getDossierAttributeConfigId());
|
||||
loadedAttributeValues = dossierAttributeClient.getDossierAttributes(dossier.getId());
|
||||
assertThat(loadedAttributeValues.getDossierAttributeList()).isEmpty();
|
||||
|
||||
dossierAttributeClient.setDossierAttributes(dossier.getId(), new DossierAttributes(dossierAttributes), auditor);
|
||||
loadedAttributeValues = dossierAttributeClient.getDossierAttributes(dossier.getId(), auditor);
|
||||
dossierAttributeClient.setDossierAttributes(dossier.getId(), new DossierAttributes(dossierAttributes));
|
||||
loadedAttributeValues = dossierAttributeClient.getDossierAttributes(dossier.getId());
|
||||
assertThat(loadedAttributeValues.getDossierAttributeList()).isNotEmpty();
|
||||
|
||||
//delete the list of dossier attribute config with child
|
||||
dossierAttributeConfigClient.deleteDossierAttributesConfig(dossier.getDossierTemplateId(),
|
||||
Lists.newArrayList(loadedAttributes.getDossierAttributeConfigs().iterator().next().getId()), auditor);
|
||||
Lists.newArrayList(loadedAttributes.getDossierAttributeConfigs().iterator().next().getId()));
|
||||
loadedAttributes = dossierAttributeConfigClient.getDossierAttributesConfig(dossier.getDossierTemplateId());
|
||||
assertThat(loadedAttributes.getDossierAttributeConfigs()).isEmpty();
|
||||
loadedAttributeValues = dossierAttributeClient.getDossierAttributes(dossier.getId(), auditor);
|
||||
loadedAttributeValues = dossierAttributeClient.getDossierAttributes(dossier.getId());
|
||||
assertThat(loadedAttributeValues.getDossierAttributeList()).isEmpty();
|
||||
|
||||
}
|
||||
|
||||
@ -158,11 +158,11 @@ public class DossierStatsTest extends AbstractPersistenceServerServiceTest {
|
||||
DossierStats dossierStats = dossierStatsClient.getDossierStats(dossier1.getId());
|
||||
assertThat(dossierStats.getNumberOfFiles()).isEqualTo(2);
|
||||
|
||||
dossierClient.archiveDossiers(Set.of(dossier1.getId()), auditor);
|
||||
dossierClient.archiveDossiers(Set.of(dossier1.getId()));
|
||||
dossierStats = dossierStatsClient.getDossierStats(dossier1.getId());
|
||||
assertThat(dossierStats.getNumberOfFiles()).isEqualTo(2);
|
||||
|
||||
dossierClient.deleteDossier(dossier1.getId(), auditor);
|
||||
dossierClient.deleteDossier(dossier1.getId());
|
||||
|
||||
var allDossiers = dossierClient.getDossiers(true, true);
|
||||
assertThat(allDossiers.size()).isEqualTo(2);
|
||||
|
||||
@ -83,7 +83,7 @@ public class DossierStatusTest extends AbstractPersistenceServerServiceTest {
|
||||
BeanUtils.copyProperties(testDossier, cru);
|
||||
cru.setDossierTemplateId(testDossier.getDossierTemplateId());
|
||||
cru.setDossierStatusId(null);
|
||||
var updated = dossierClient.createDossierOrUpdateDossier(cru, auditor).getBody();
|
||||
var updated = dossierClient.createDossierOrUpdateDossier(cru).getBody();
|
||||
assertThat(updated.getDossierStatusId()).isNull();
|
||||
|
||||
updatedStatus = dossierStatusClient.getDossierStatus(loadedDossierStatus.getId());
|
||||
@ -124,7 +124,7 @@ public class DossierStatusTest extends AbstractPersistenceServerServiceTest {
|
||||
BeanUtils.copyProperties(testDossier, cru2);
|
||||
cru2.setDossierTemplateId(testDossier.getDossierTemplateId());
|
||||
cru2.setDossierStatusId(loadedDossierStatus.getId());
|
||||
updated = dossierClient.createDossierOrUpdateDossier(cru2, auditor).getBody();
|
||||
updated = dossierClient.createDossierOrUpdateDossier(cru2).getBody();
|
||||
assertThat(updated.getDossierStatusId()).isNotNull();
|
||||
//delete and replace
|
||||
dossierStatusClient.deleteDossierStatus(loadedDossierStatus.getId(), loadedDossierStatus2.getId());
|
||||
|
||||
@ -148,7 +148,7 @@ public class DossierTemplateImportTest extends AbstractPersistenceServerServiceT
|
||||
public void dossierImportClientTest() {
|
||||
|
||||
var multipartFile = loadMultiPartFileFromClasspath("EFSA_sanitisation_GFL_v1.zip");
|
||||
DossierTemplateModel dossierTemplateModel = dossierTemplateClient.importDossierTemplate(multipartFile, null, false, auditor);
|
||||
DossierTemplateModel dossierTemplateModel = dossierTemplateClient.importDossierTemplate(multipartFile, null, false);
|
||||
assertThat(dossierTemplateModel).isNotNull();
|
||||
assertThat(dossierTemplateModel.getId()).isNotBlank();
|
||||
|
||||
|
||||
@ -100,7 +100,7 @@ public class DossierTemplateStatsTest extends AbstractPersistenceServerServiceTe
|
||||
.description("Something")
|
||||
.addToDictionaryAction(false)
|
||||
.dossierTemplateId(dossier.getDossierTemplateId())
|
||||
.build(), auditor);
|
||||
.build());
|
||||
|
||||
assertThat(addedType1).isNotNull();
|
||||
|
||||
@ -115,13 +115,13 @@ public class DossierTemplateStatsTest extends AbstractPersistenceServerServiceTe
|
||||
.addToDictionaryAction(false)
|
||||
.dossierTemplateId(dossierTemplate2.getId())
|
||||
.hasDictionary(true)
|
||||
.build(), auditor);
|
||||
.build());
|
||||
|
||||
assertThat(addedType).isNotNull();
|
||||
var entries1 = new ArrayList<String>();
|
||||
entries1.add("entry1");
|
||||
entries1.add("entry2");
|
||||
dictionaryClient.addEntry(addedType.getType(), addedType.getDossierTemplateId(), entries1, false, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(addedType.getType(), addedType.getDossierTemplateId(), entries1, false, null, DictionaryEntryType.ENTRY);
|
||||
|
||||
var dictionary = dictionaryClient.getDictionaryForType(addedType.getType(), addedType.getDossierTemplateId(), null);
|
||||
assertThat(dictionary.getEntries().size()).isEqualTo(entries1.size());
|
||||
@ -135,12 +135,12 @@ public class DossierTemplateStatsTest extends AbstractPersistenceServerServiceTe
|
||||
.addToDictionaryAction(false)
|
||||
.dossierTemplateId(dossierTemplate2.getId())
|
||||
.hasDictionary(true)
|
||||
.build(), auditor);
|
||||
.build());
|
||||
var entries2 = new ArrayList<String>();
|
||||
entries2.add("entry1");
|
||||
entries2.add("entry2");
|
||||
entries2.add("entry3");
|
||||
dictionaryClient.addEntry(addedType2.getType(), addedType2.getDossierTemplateId(), entries2, false, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(addedType2.getType(), addedType2.getDossierTemplateId(), entries2, false, null, DictionaryEntryType.ENTRY);
|
||||
|
||||
dictionary = dictionaryClient.getDictionaryForType(addedType2.getType(), addedType.getDossierTemplateId(), null);
|
||||
assertThat(dictionary.getEntries().size()).isEqualTo(entries2.size());
|
||||
@ -155,13 +155,13 @@ public class DossierTemplateStatsTest extends AbstractPersistenceServerServiceTe
|
||||
.addToDictionaryAction(false)
|
||||
.dossierTemplateId(dossierTemplate3.getId())
|
||||
.hasDictionary(true)
|
||||
.build(), auditor);
|
||||
.build());
|
||||
|
||||
assertThat(addedType3).isNotNull();
|
||||
var entries3 = new ArrayList<String>();
|
||||
entries3.add("entry1");
|
||||
entries3.add("entry2");
|
||||
dictionaryClient.addEntry(addedType3.getType(), addedType3.getDossierTemplateId(), entries3, false, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(addedType3.getType(), addedType3.getDossierTemplateId(), entries3, false, null, DictionaryEntryType.ENTRY);
|
||||
|
||||
dictionary = dictionaryClient.getDictionaryForType(addedType3.getType(), addedType3.getDossierTemplateId(), null);
|
||||
assertThat(dictionary.getEntries().size()).isEqualTo(entries3.size());
|
||||
@ -179,7 +179,7 @@ public class DossierTemplateStatsTest extends AbstractPersistenceServerServiceTe
|
||||
.addToDictionaryAction(false)
|
||||
.dossierTemplateId(dossierTemplate5.getId())
|
||||
.hasDictionary(true)
|
||||
.build(), auditor);
|
||||
.build());
|
||||
assertThat(addedType5).isNotNull();
|
||||
|
||||
Set<String> dossierTemplateIds = new HashSet<>();
|
||||
@ -214,7 +214,7 @@ public class DossierTemplateStatsTest extends AbstractPersistenceServerServiceTe
|
||||
var entries22 = new ArrayList<String>();
|
||||
entries22.add(entries2.get(2));
|
||||
|
||||
dictionaryClient.deleteEntries(addedType2.getType(), addedType2.getDossierTemplateId(), entries22, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.deleteEntries(addedType2.getType(), addedType2.getDossierTemplateId(), entries22, null, DictionaryEntryType.ENTRY);
|
||||
dossierTemplateStatsList = dossierTemplateStatsClient.getDossierTemplateStats(dossierTemplateIds);
|
||||
|
||||
assertThat(dossierTemplateStatsList.size()).isEqualTo(dossierTemplateIds.size());
|
||||
@ -231,7 +231,7 @@ public class DossierTemplateStatsTest extends AbstractPersistenceServerServiceTe
|
||||
entries23.add(entries2.get(0));
|
||||
entries23.add(entries2.get(1));
|
||||
|
||||
dictionaryClient.deleteEntries(addedType2.getType(), addedType2.getDossierTemplateId(), entries23, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.deleteEntries(addedType2.getType(), addedType2.getDossierTemplateId(), entries23, null, DictionaryEntryType.ENTRY);
|
||||
|
||||
dictionary = dictionaryClient.getDictionaryForType(addedType2.getType(), addedType.getDossierTemplateId(), null);
|
||||
var entries23loaded = dictionary.getEntries();
|
||||
@ -260,7 +260,7 @@ public class DossierTemplateStatsTest extends AbstractPersistenceServerServiceTe
|
||||
cru.setValidFrom(OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS));
|
||||
cru.setValidTo(OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS));
|
||||
|
||||
return dossierTemplateClient.createOrUpdateDossierTemplate(cru, auditor);
|
||||
return dossierTemplateClient.createOrUpdateDossierTemplate(cru);
|
||||
}
|
||||
|
||||
|
||||
@ -288,30 +288,30 @@ public class DossierTemplateStatsTest extends AbstractPersistenceServerServiceTe
|
||||
|
||||
if (k == 1){
|
||||
fileStatusPersistenceService.updateProcessingStatus(fileId, k, 0L, 0L, 0L, 0L, 0L, 1, 1);
|
||||
reanalysisClient.excludePages(dossier.getId(), fileId, new PageExclusionRequest(List.of(new PageRange(k, k))), auditor);
|
||||
reanalysisClient.excludePages(dossier.getId(), fileId, new PageExclusionRequest(List.of(new PageRange(k, k))));
|
||||
}
|
||||
if (k ==2) {
|
||||
fileManagementClient.deleteFile(dossier.getId(), fileId, auditor);
|
||||
fileManagementClient.deleteFile(dossier.getId(), fileId);
|
||||
}
|
||||
if (k == 3){
|
||||
fileManagementClient.hardDeleteFiles(dossier.getId(), Set.of(fileId), auditor);
|
||||
fileManagementClient.hardDeleteFiles(dossier.getId(), Set.of(fileId));
|
||||
}
|
||||
if (k == 4){
|
||||
fileClient.setStatusUnderReview(dossier.getId(), fileId, userId, auditor);
|
||||
fileClient.setStatusUnderReview(dossier.getId(), fileId, userId);
|
||||
}
|
||||
if (k == 5){
|
||||
fileClient.setStatusUnderApproval(dossier.getId(), fileId, userId, auditor);
|
||||
fileClient.setStatusUnderApproval(dossier.getId(), fileId, userId);
|
||||
}
|
||||
}
|
||||
|
||||
if (j == 1) {
|
||||
dossierClient.archiveDossiers(Set.of(dossier.getId()), auditor);
|
||||
dossierClient.archiveDossiers(Set.of(dossier.getId()));
|
||||
}
|
||||
if (j == 2) {
|
||||
dossierClient.deleteDossier(dossier.getId(), auditor);
|
||||
dossierClient.deleteDossier(dossier.getId());
|
||||
}
|
||||
if (j == 3) {
|
||||
dossierClient.hardDeleteDossiers(Set.of(dossier.getId()), auditor);
|
||||
dossierClient.hardDeleteDossiers(Set.of(dossier.getId()));
|
||||
}
|
||||
|
||||
}
|
||||
@ -326,7 +326,7 @@ public class DossierTemplateStatsTest extends AbstractPersistenceServerServiceTe
|
||||
.rank(100)
|
||||
.build());
|
||||
var dossier = dossierTesterAndProvider.provideTestDossierQuick(template, "test dossier: ", status);
|
||||
dossierClient.deleteDossier(dossier.getId(), auditor);
|
||||
dossierClient.deleteDossier(dossier.getId());
|
||||
|
||||
var cru = new DossierTemplateModel();
|
||||
cru.setDossierTemplateId(template.getId());
|
||||
@ -334,7 +334,7 @@ public class DossierTemplateStatsTest extends AbstractPersistenceServerServiceTe
|
||||
cru.setName(template.getName());
|
||||
cru.setValidTo(OffsetDateTime.now().minusHours(1).truncatedTo(ChronoUnit.MILLIS));
|
||||
|
||||
var result = dossierTemplateClient.createOrUpdateDossierTemplate(cru, auditor);
|
||||
var result = dossierTemplateClient.createOrUpdateDossierTemplate(cru);
|
||||
|
||||
long t1 = System.currentTimeMillis();
|
||||
var stats = dossierTemplateStatsClient.getDossierTemplateStats(Set.of(template.getId()));
|
||||
|
||||
@ -115,7 +115,7 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
var dossierTemplate = dossierTemplateTesterAndProvider.provideTestTemplate();
|
||||
|
||||
// test the export of dossier template
|
||||
dossierTemplateClient.prepareExportDownload(dossierTemplate.getId(), auditor);
|
||||
dossierTemplateClient.prepareExportDownload(dossierTemplate.getId());
|
||||
var statuses = downloadClient.getDownloadStatus();
|
||||
assertThat(statuses.getDownloadStatus()).isNotEmpty();
|
||||
}
|
||||
@ -138,7 +138,7 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
cru.setName("Template 1 Update");
|
||||
cru.setApplyDictionaryUpdatesToAllDossiersByDefault(true);
|
||||
|
||||
var updated = dossierTemplateClient.createOrUpdateDossierTemplate(cru, auditor);
|
||||
var updated = dossierTemplateClient.createOrUpdateDossierTemplate(cru);
|
||||
assertThat(updated.getName()).isEqualTo("Template 1 Update");
|
||||
assertThat(updated.isApplyDictionaryUpdatesToAllDossiersByDefault()).isTrue();
|
||||
|
||||
@ -148,21 +148,21 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
assertThat(loadedTemplate.getDossierTemplateStatus()).isEqualTo(DossierTemplateStatus.ACTIVE);
|
||||
|
||||
updated = dossierTemplateClient.createOrUpdateDossierTemplate(cru, auditor);
|
||||
updated = dossierTemplateClient.createOrUpdateDossierTemplate(cru);
|
||||
|
||||
assertThat(updated.getName()).isEqualTo("Template 1 Update");
|
||||
|
||||
var testDossier = dossierTesterAndProvider.provideTestDossier(updated);
|
||||
|
||||
try {
|
||||
dossierTemplateClient.deleteDossierTemplate(updated.getId(), auditor);
|
||||
dossierTemplateClient.deleteDossierTemplate(updated.getId());
|
||||
} catch (FeignException e) {
|
||||
assertThat(e.status()).isEqualTo(409);
|
||||
}
|
||||
|
||||
dossierClient.hardDeleteDossiers(Collections.singleton(testDossier.getId()), auditor);
|
||||
dossierClient.hardDeleteDossiers(Collections.singleton(testDossier.getId()));
|
||||
|
||||
dossierTemplateClient.deleteDossierTemplate(updated.getId(), auditor);
|
||||
dossierTemplateClient.deleteDossierTemplate(updated.getId());
|
||||
assertThat(dossierTemplateClient.getAllDossierTemplates().isEmpty()).isTrue();
|
||||
}
|
||||
|
||||
@ -222,15 +222,15 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
.hasDictionary(true)
|
||||
.build();
|
||||
|
||||
var createdType1 = dictionaryClient.addType(type, auditor);
|
||||
var createdType2 = dictionaryClient.addType(type2, auditor);
|
||||
var createdType1 = dictionaryClient.addType(type);
|
||||
var createdType2 = dictionaryClient.addType(type2);
|
||||
|
||||
var loadedType1 = dictionaryClient.getDictionaryForType(createdType1.getType(), createdType1.getDossierTemplateId(), null);
|
||||
var loadedType2 = dictionaryClient.getDictionaryForType(createdType2.getType(), createdType2.getDossierTemplateId(), null);
|
||||
|
||||
dictionaryClient.addEntry(createdType1.getType(), createdType1.getDossierTemplateId(), List.of("entry1", "entry2"), false, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(createdType1.getType(), createdType1.getDossierTemplateId(), List.of("entry3", "entry4"), false, null, DictionaryEntryType.FALSE_POSITIVE, auditor);
|
||||
dictionaryClient.addEntry(createdType1.getType(), createdType1.getDossierTemplateId(), List.of("entry5", "entry6"), false, null, DictionaryEntryType.FALSE_RECOMMENDATION, auditor);
|
||||
dictionaryClient.addEntry(createdType1.getType(), createdType1.getDossierTemplateId(), List.of("entry1", "entry2"), false, null, DictionaryEntryType.ENTRY);
|
||||
dictionaryClient.addEntry(createdType1.getType(), createdType1.getDossierTemplateId(), List.of("entry3", "entry4"), false, null, DictionaryEntryType.FALSE_POSITIVE);
|
||||
dictionaryClient.addEntry(createdType1.getType(), createdType1.getDossierTemplateId(), List.of("entry5", "entry6"), false, null, DictionaryEntryType.FALSE_RECOMMENDATION);
|
||||
|
||||
dossierAttributeConfigClient.setDossierAttributesConfig(dossierTemplate.getId(),
|
||||
new DossierAttributesConfig(List.of(DossierAttributeConfig.builder()
|
||||
@ -240,7 +240,7 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
.label("labelDossierAttribute")
|
||||
.type(DossierAttributeType.TEXT)
|
||||
.placeholder("placeholderDossier")
|
||||
.build())), auditor);
|
||||
.build())));
|
||||
fileAttributeConfigClient.setFileAttributesConfig(dossierTemplate.getId(),
|
||||
new FileAttributesConfig(List.of(FileAttributeConfig.builder()
|
||||
.dossierTemplateId(dossierTemplate.getId())
|
||||
@ -253,9 +253,9 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
.label("labelFileAttribute")
|
||||
.type(FileAttributeType.TEXT)
|
||||
.placeholder("placeholderFile")
|
||||
.build())), auditor);
|
||||
.build())));
|
||||
var template = new MockMultipartFile("template", "asd".getBytes());
|
||||
reportTemplateClient.uploadTemplate(template, dossierTemplate.getId(), true, false, auditor);
|
||||
reportTemplateClient.uploadTemplate(template, dossierTemplate.getId(), true, false);
|
||||
var col = Colors.builder()
|
||||
.dossierTemplateId(dossierTemplate.getId())
|
||||
.appliedRedactionColor("#cccccc")
|
||||
@ -272,7 +272,7 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
.redactionColor("#999999")
|
||||
.updatedColor("#aaaaaa")
|
||||
.build();
|
||||
dictionaryClient.setColors(dossierTemplate.getId(), col, auditor);
|
||||
dictionaryClient.setColors(dossierTemplate.getId(), col);
|
||||
var dossierStatus = DossierStatusRequest.builder()
|
||||
.name("dossStatus1")
|
||||
.description("ds description")
|
||||
@ -294,14 +294,14 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
watermark.setDossierTemplateId(dossierTemplate.getId());
|
||||
watermark.setCreatedBy("user");
|
||||
|
||||
watermarkClient.saveWatermark(watermark, auditor);
|
||||
watermarkClient.saveWatermark(watermark);
|
||||
|
||||
var allTemplates = dossierTemplateClient.getAllDossierTemplates();
|
||||
assertThat(allTemplates.size()).isEqualTo(1);
|
||||
assertThat(allTemplates.get(0)).isEqualTo(dossierTemplate);
|
||||
|
||||
CloneDossierTemplateRequest cdtr = CloneDossierTemplateRequest.builder().name("Clone of " + dossierTemplate.getName()).cloningUserId("user").build();
|
||||
var clonedDT = dossierTemplateClient.cloneDossierTemplate(dossierTemplate.getId(), cdtr, auditor);
|
||||
var clonedDT = dossierTemplateClient.cloneDossierTemplate(dossierTemplate.getId(), cdtr);
|
||||
assertThat(clonedDT.getName()).isEqualTo("Clone of " + dossierTemplate.getName());
|
||||
|
||||
var loadedTemplate = dossierTemplateClient.getDossierTemplate(clonedDT.getId());
|
||||
@ -357,7 +357,7 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
var dossierTemplate = dossierTemplateTesterAndProvider.provideTestTemplate();
|
||||
setupDossierTemplate(dossierTemplate);
|
||||
|
||||
dossierTemplateClient.prepareExportDownload(dossierTemplate.getId(), auditor);
|
||||
dossierTemplateClient.prepareExportDownload(dossierTemplate.getId());
|
||||
var statuses = downloadClient.getDownloadStatus();
|
||||
assertThat(statuses.getDownloadStatus()).isNotEmpty();
|
||||
|
||||
@ -397,15 +397,15 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
.hasDictionary(true)
|
||||
.build();
|
||||
|
||||
var createdType1 = dictionaryClient.addType(type, auditor);
|
||||
var createdType2 = dictionaryClient.addType(type2, auditor);
|
||||
var createdType1 = dictionaryClient.addType(type);
|
||||
var createdType2 = dictionaryClient.addType(type2);
|
||||
|
||||
var loadedType1 = dictionaryClient.getDictionaryForType(createdType1.getType(), createdType1.getDossierTemplateId(), null);
|
||||
var loadedType2 = dictionaryClient.getDictionaryForType(createdType2.getType(), createdType2.getDossierTemplateId(), null);
|
||||
|
||||
dictionaryClient.addEntry(createdType1.getType(), createdType1.getDossierTemplateId(), List.of("entry1", "entry2"), false, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(createdType1.getType(), createdType1.getDossierTemplateId(), List.of("entry3", "entry4"), false, null, DictionaryEntryType.FALSE_POSITIVE, auditor);
|
||||
dictionaryClient.addEntry(createdType1.getType(), createdType1.getDossierTemplateId(), List.of("entry5", "entry6"), false, null, DictionaryEntryType.FALSE_RECOMMENDATION, auditor);
|
||||
dictionaryClient.addEntry(createdType1.getType(), createdType1.getDossierTemplateId(), List.of("entry1", "entry2"), false, null, DictionaryEntryType.ENTRY);
|
||||
dictionaryClient.addEntry(createdType1.getType(), createdType1.getDossierTemplateId(), List.of("entry3", "entry4"), false, null, DictionaryEntryType.FALSE_POSITIVE);
|
||||
dictionaryClient.addEntry(createdType1.getType(), createdType1.getDossierTemplateId(), List.of("entry5", "entry6"), false, null, DictionaryEntryType.FALSE_RECOMMENDATION);
|
||||
|
||||
dossierAttributeConfigClient.setDossierAttributesConfig(dossierTemplate.getId(),
|
||||
new DossierAttributesConfig(List.of(DossierAttributeConfig.builder()
|
||||
@ -415,7 +415,7 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
.label("labelDossierAttribute")
|
||||
.type(DossierAttributeType.TEXT)
|
||||
.placeholder("placeholderDossier")
|
||||
.build())), auditor);
|
||||
.build())));
|
||||
fileAttributeConfigClient.setFileAttributesConfig(dossierTemplate.getId(),
|
||||
new FileAttributesConfig(List.of(FileAttributeConfig.builder()
|
||||
.dossierTemplateId(dossierTemplate.getId())
|
||||
@ -428,10 +428,10 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
.label("labelFileAttribute")
|
||||
.type(FileAttributeType.TEXT)
|
||||
.placeholder("placeholderFile")
|
||||
.build())), auditor);
|
||||
.build())));
|
||||
|
||||
var template = new MockMultipartFile("template", "asd".getBytes());
|
||||
reportTemplateClient.uploadTemplate(template, dossierTemplate.getId(), true, false, auditor);
|
||||
reportTemplateClient.uploadTemplate(template, dossierTemplate.getId(), true, false);
|
||||
var col = Colors.builder()
|
||||
.dossierTemplateId(dossierTemplate.getId())
|
||||
.appliedRedactionColor("#cccccc")
|
||||
@ -448,7 +448,7 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
.redactionColor("#999999")
|
||||
.updatedColor("#aaaaaa")
|
||||
.build();
|
||||
dictionaryClient.setColors(dossierTemplate.getId(), col, auditor);
|
||||
dictionaryClient.setColors(dossierTemplate.getId(), col);
|
||||
var dossierStatus = DossierStatusRequest.builder()
|
||||
.name("dossStatus1")
|
||||
.description("ds description")
|
||||
@ -470,7 +470,7 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
watermark.setDossierTemplateId(dossierTemplate.getId());
|
||||
watermark.setCreatedBy("user");
|
||||
|
||||
watermarkClient.saveWatermark(watermark, auditor);
|
||||
watermarkClient.saveWatermark(watermark);
|
||||
}
|
||||
|
||||
|
||||
@ -480,7 +480,7 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
var dossierTemplate = dossierTemplateTesterAndProvider.provideTestTemplate();
|
||||
|
||||
dossierTemplateClient.prepareExportDownload(dossierTemplate.getId(), auditor);
|
||||
dossierTemplateClient.prepareExportDownload(dossierTemplate.getId());
|
||||
var statuses = downloadClient.getDownloadStatus();
|
||||
assertThat(statuses.getDownloadStatus()).isNotEmpty();
|
||||
|
||||
@ -500,11 +500,11 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(existingLegalBasis.size()).isEqualTo(1);
|
||||
|
||||
// delete justifications for export
|
||||
legalBasisClient.deleteLegalBasis(dossierTemplate.getId(), existingLegalBasis.stream().map(LegalBasis::getName).collect(Collectors.toList()), auditor);
|
||||
legalBasisClient.deleteLegalBasis(dossierTemplate.getId(), existingLegalBasis.stream().map(LegalBasis::getName).collect(Collectors.toList()));
|
||||
existingLegalBasis = legalBasisClient.getLegalBasisMapping(dossierTemplate.getId());
|
||||
assertThat(existingLegalBasis.isEmpty()).isTrue();
|
||||
|
||||
dossierTemplateClient.prepareExportDownload(dossierTemplate.getId(), auditor);
|
||||
dossierTemplateClient.prepareExportDownload(dossierTemplate.getId());
|
||||
var statuses = downloadClient.getDownloadStatus();
|
||||
assertThat(statuses.getDownloadStatus()).isNotEmpty();
|
||||
|
||||
@ -512,7 +512,7 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
exportDownloadReportMessageReceiver.receive(new DownloadJob(status.getUserId(), status.getStorageId()));
|
||||
|
||||
// add new justifications
|
||||
legalBasisClient.setLegalBasisMapping(List.of(new LegalBasis("nameAgain", "description", "reason")), dossierTemplate.getId(), auditor);
|
||||
legalBasisClient.setLegalBasisMapping(List.of(new LegalBasis("nameAgain", "description", "reason")), dossierTemplate.getId());
|
||||
existingLegalBasis = legalBasisClient.getLegalBasisMapping(dossierTemplate.getId());
|
||||
assertThat(existingLegalBasis.size()).isEqualTo(1);
|
||||
|
||||
@ -524,14 +524,14 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
cru.setDescription("new description");
|
||||
cru.setKeepImageMetadata(true);
|
||||
|
||||
var updated = dossierTemplateClient.createOrUpdateDossierTemplate(cru, auditor);
|
||||
var updated = dossierTemplateClient.createOrUpdateDossierTemplate(cru);
|
||||
assertThat(updated.getName()).isNotEqualTo(dossierTemplate.getName());
|
||||
|
||||
var storedObject = fileManagementStorageService.getObject(TenantContext.getTenantId(), status.getStorageId());
|
||||
|
||||
var importTemplate = new MockMultipartFile("import.zip", "import.zip", "application/zip", storedObject);
|
||||
|
||||
var dossierImported = dossierTemplateClient.importDossierTemplate(importTemplate, dossierTemplate.getId(), true, auditor);
|
||||
var dossierImported = dossierTemplateClient.importDossierTemplate(importTemplate, dossierTemplate.getId(), true);
|
||||
// assertThat(dossierImported).isNotNull();
|
||||
|
||||
existingLegalBasis = legalBasisClient.getLegalBasisMapping(dossierTemplate.getId());
|
||||
@ -738,7 +738,7 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
dossierTemplateModel.setValidTo(OffsetDateTime.now().plusHours(1).truncatedTo(ChronoUnit.MILLIS));
|
||||
dossierTemplateModel.setOcrByDefault(true);
|
||||
|
||||
DossierTemplateModel result = dossierTemplateClient.createOrUpdateDossierTemplate(dossierTemplateModel, auditor);
|
||||
DossierTemplateModel result = dossierTemplateClient.createOrUpdateDossierTemplate(dossierTemplateModel);
|
||||
assertThat(result.getName()).isEqualTo(name);
|
||||
assertThat(result.isOcrByDefault()).isTrue();
|
||||
|
||||
@ -747,7 +747,7 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
dossierTemplateModel.setName("Test Dossier Template Update");
|
||||
dossierTemplateModel.setOcrByDefault(false);
|
||||
loadedTemplate = dossierTemplateClient.createOrUpdateDossierTemplate(dossierTemplateModel, auditor);
|
||||
loadedTemplate = dossierTemplateClient.createOrUpdateDossierTemplate(dossierTemplateModel);
|
||||
assertThat(loadedTemplate.isOcrByDefault()).isFalse();
|
||||
}
|
||||
|
||||
@ -764,7 +764,7 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
dossierTemplateModel.setValidTo(OffsetDateTime.now().plusHours(1).truncatedTo(ChronoUnit.MILLIS));
|
||||
dossierTemplateModel.setRemoveWatermark(true);
|
||||
|
||||
DossierTemplateModel result = dossierTemplateClient.createOrUpdateDossierTemplate(dossierTemplateModel, auditor);
|
||||
DossierTemplateModel result = dossierTemplateClient.createOrUpdateDossierTemplate(dossierTemplateModel);
|
||||
assertThat(result.getName()).isEqualTo(name);
|
||||
assertThat(result.isRemoveWatermark()).isTrue();
|
||||
|
||||
@ -773,7 +773,7 @@ public class DossierTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
dossierTemplateModel.setName("Test Dossier Template Update");
|
||||
dossierTemplateModel.setRemoveWatermark(false);
|
||||
loadedTemplate = dossierTemplateClient.createOrUpdateDossierTemplate(dossierTemplateModel, auditor);
|
||||
loadedTemplate = dossierTemplateClient.createOrUpdateDossierTemplate(dossierTemplateModel);
|
||||
assertThat(loadedTemplate.isRemoveWatermark()).isFalse();
|
||||
}
|
||||
|
||||
|
||||
@ -115,11 +115,11 @@ public class DossierTest extends AbstractPersistenceServerServiceTest {
|
||||
watermark.setOrientation(WatermarkOrientation.DIAGONAL);
|
||||
watermark.setDossierTemplateId(dossier.getDossierTemplateId());
|
||||
|
||||
var watermarkConfig = watermarkClient.saveWatermark(watermark, auditor);
|
||||
var watermarkConfig = watermarkClient.saveWatermark(watermark);
|
||||
|
||||
watermark.setEnabled(false);
|
||||
watermark.setName("watermark disabled");
|
||||
var watermarkConfigDisabled = watermarkClient.saveWatermark(watermark, auditor);
|
||||
var watermarkConfigDisabled = watermarkClient.saveWatermark(watermark);
|
||||
|
||||
var allDossiers = dossierClient.getDossiers(false, false);
|
||||
assertThat(allDossiers.size()).isEqualTo(1);
|
||||
@ -148,7 +148,7 @@ public class DossierTest extends AbstractPersistenceServerServiceTest {
|
||||
cru.setDossierStatusId(loadedDossierStatus.getId());
|
||||
|
||||
try {
|
||||
dossierClient.createDossierOrUpdateDossier(cru, auditor);
|
||||
dossierClient.createDossierOrUpdateDossier(cru);
|
||||
} catch (FeignException e) {
|
||||
assertThat(e.status()).isEqualTo(400);
|
||||
}
|
||||
@ -156,7 +156,7 @@ public class DossierTest extends AbstractPersistenceServerServiceTest {
|
||||
cru.setPreviewWatermarkId(watermarkConfig.getId());
|
||||
// update the watermark preview to an enabled one
|
||||
cru.setDossierId(dossier.getId());
|
||||
var updated = dossierClient.createDossierOrUpdateDossier(cru, auditor).getBody();
|
||||
var updated = dossierClient.createDossierOrUpdateDossier(cru).getBody();
|
||||
assertThat(updated.getDossierName()).isEqualTo("Dossier 1 Update");
|
||||
assertThat(updated.getWatermarkId()).isNull();
|
||||
assertThat(updated.getPreviewWatermarkId()).isEqualTo(watermarkConfig.getId());
|
||||
@ -166,12 +166,12 @@ public class DossierTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
// disable the watermark used
|
||||
watermarkConfig.setEnabled(false);
|
||||
var watermarkDisabled = watermarkClient.saveWatermark(watermarkConfig, auditor);
|
||||
var watermarkDisabled = watermarkClient.saveWatermark(watermarkConfig);
|
||||
assertThat(watermarkDisabled.isEnabled()).isFalse();
|
||||
assertThat(watermarkDisabled.getId()).isEqualTo(watermarkConfig.getId());
|
||||
// update dossier description, while the watermark used was disabled
|
||||
cru.setDescription("new description");
|
||||
updated = dossierClient.createDossierOrUpdateDossier(cru, auditor).getBody();
|
||||
updated = dossierClient.createDossierOrUpdateDossier(cru).getBody();
|
||||
assertThat(updated.getDescription()).isEqualTo(cru.getDescription());
|
||||
assertThat(updated.getPreviewWatermarkId()).isEqualTo(watermarkConfig.getId());
|
||||
assertThat(updated.getWatermarkId()).isNull();
|
||||
@ -179,7 +179,7 @@ public class DossierTest extends AbstractPersistenceServerServiceTest {
|
||||
cru.setPreviewWatermarkId(watermarkConfigDisabled.getId());
|
||||
//try to update the dossier with a different disabled watermark
|
||||
try {
|
||||
dossierClient.createDossierOrUpdateDossier(cru, auditor);
|
||||
dossierClient.createDossierOrUpdateDossier(cru);
|
||||
} catch (FeignException e) {
|
||||
assertThat(e.status()).isEqualTo(400);
|
||||
}
|
||||
@ -187,32 +187,32 @@ public class DossierTest extends AbstractPersistenceServerServiceTest {
|
||||
// put dossier status to null
|
||||
cru.setPreviewWatermarkId(watermarkConfig.getId());
|
||||
cru.setDossierStatusId(null);
|
||||
updated = dossierClient.createDossierOrUpdateDossier(cru, auditor).getBody();
|
||||
updated = dossierClient.createDossierOrUpdateDossier(cru).getBody();
|
||||
assertThat(updated.getDossierStatusId()).isNull();
|
||||
|
||||
var loadedTemplate = dossierClient.getDossier(updated.getId(), false, false);
|
||||
|
||||
assertThat(loadedTemplate).isEqualTo(updated);
|
||||
|
||||
dossierClient.getDossiers(false, false).forEach(ld -> dossierClient.deleteDossier(ld.getId(), auditor));
|
||||
dossierClient.getDossiers(false, false).forEach(ld -> dossierClient.deleteDossier(ld.getId()));
|
||||
|
||||
assertThat(dossierClient.getDossiers(false, false)).isEmpty();
|
||||
assertThat(dossierClient.getSoftDeletedDossiers().size()).isEqualTo(1);
|
||||
assertThat(dossierClient.getDossiers(false, true)).hasSize(1);
|
||||
|
||||
dossierClient.undeleteDossiers(Sets.newHashSet(dossier.getId()), auditor);
|
||||
dossierClient.undeleteDossiers(Sets.newHashSet(dossier.getId()));
|
||||
|
||||
assertThat(dossierClient.getDossiers(false, false)).isNotEmpty();
|
||||
assertThat(dossierClient.getSoftDeletedDossiers()).isEmpty();
|
||||
|
||||
dossierClient.hardDeleteDossiers(Sets.newHashSet(dossier.getId()), auditor);
|
||||
dossierClient.hardDeleteDossiers(Sets.newHashSet(dossier.getId()));
|
||||
assertThat(dossierClient.getDossiers(false, false)).isEmpty();
|
||||
assertThat(dossierClient.getDossiers(true, false)).isEmpty();
|
||||
assertThat(dossierClient.getDossiers(false, true)).hasSize(0);
|
||||
assertThat(dossierClient.getDossiers(true, true)).hasSize(0);
|
||||
assertThat(dossierClient.getSoftDeletedDossiers()).isEmpty();
|
||||
|
||||
assertThatThrownBy(() -> dossierClient.undeleteDossiers(Sets.newHashSet(dossier.getId()), auditor)).isInstanceOf(FeignException.class);
|
||||
assertThatThrownBy(() -> dossierClient.undeleteDossiers(Sets.newHashSet(dossier.getId()))).isInstanceOf(FeignException.class);
|
||||
|
||||
var dossierInformation = dossierClient.getDossierInformation();
|
||||
assertThat(dossierInformation.getNumberOfActiveDossiers()).isEqualTo(0);
|
||||
@ -242,7 +242,7 @@ public class DossierTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(dossierClient.getSoftDeletedDossiers()).hasSize(0);
|
||||
|
||||
// Act & Assert 2
|
||||
dossierClient.archiveDossiers(Set.of(dossier1.getId()), auditor);
|
||||
dossierClient.archiveDossiers(Set.of(dossier1.getId()));
|
||||
assertThat(dossierClient.getDossiers(false, false)).hasSize(1);
|
||||
assertThat(dossierClient.getDossiers(true, false)).hasSize(2);
|
||||
assertThat(dossierClient.getDossiers(false, true)).hasSize(1);
|
||||
@ -270,7 +270,7 @@ public class DossierTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(dossierInformation.getNumberOfArchivedDossiers()).isEqualTo(0);
|
||||
|
||||
// Act & Assert 4
|
||||
dossierClient.archiveDossiers(Set.of(dossier1.getId(), dossier2.getId()), auditor);
|
||||
dossierClient.archiveDossiers(Set.of(dossier1.getId(), dossier2.getId()));
|
||||
assertThat(dossierClient.getDossiers(false, false)).hasSize(0);
|
||||
assertThat(dossierClient.getDossiers(true, false)).hasSize(2);
|
||||
assertThat(dossierClient.getArchivedDossiers()).hasSize(2);
|
||||
@ -283,8 +283,8 @@ public class DossierTest extends AbstractPersistenceServerServiceTest {
|
||||
// assertThat(dossierInformation.getNumberOfArchivedDossiers()).isEqualTo(2);
|
||||
|
||||
// Act & Assert 5
|
||||
dossierClient.deleteDossier(dossier1.getId(), auditor);
|
||||
dossierClient.archiveDossiers(Set.of(dossier1.getId(), dossier2.getId()), auditor);
|
||||
dossierClient.deleteDossier(dossier1.getId());
|
||||
dossierClient.archiveDossiers(Set.of(dossier1.getId(), dossier2.getId()));
|
||||
assertThat(dossierClient.getDossiers(false, false)).hasSize(0);
|
||||
assertThat(dossierClient.getDossiers(true, false)).hasSize(1);
|
||||
assertThat(dossierClient.getDossiers(false, true)).hasSize(1);
|
||||
@ -313,8 +313,8 @@ public class DossierTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(dossierInformation.getNumberOfArchivedDossiers()).isEqualTo(0);
|
||||
|
||||
// Act & Assert 7
|
||||
dossierClient.hardDeleteDossiers(Set.of(dossier1.getId()), auditor);
|
||||
dossierClient.archiveDossiers(Set.of(dossier1.getId(), dossier2.getId()), auditor);
|
||||
dossierClient.hardDeleteDossiers(Set.of(dossier1.getId()));
|
||||
dossierClient.archiveDossiers(Set.of(dossier1.getId(), dossier2.getId()));
|
||||
assertThat(dossierClient.getDossiers(false, false)).hasSize(0);
|
||||
assertThat(dossierClient.getDossiers(true, false)).hasSize(1);
|
||||
assertThat(dossierClient.getDossiers(false, true)).hasSize(0);
|
||||
@ -342,7 +342,7 @@ public class DossierTest extends AbstractPersistenceServerServiceTest {
|
||||
watermark.setOrientation(WatermarkOrientation.DIAGONAL);
|
||||
watermark.setDossierTemplateId(dossier.getDossierTemplateId());
|
||||
|
||||
var watermarkConfig = watermarkClient.saveWatermark(watermark, auditor);
|
||||
var watermarkConfig = watermarkClient.saveWatermark(watermark);
|
||||
|
||||
String dossierName = "Dossier 1 Update";
|
||||
|
||||
@ -360,7 +360,7 @@ public class DossierTest extends AbstractPersistenceServerServiceTest {
|
||||
cru.setPreviewWatermarkId(watermarkConfig.getId());
|
||||
cru.setReportTemplateIds(Set.of(availableTemplates.get(0).getTemplateId(), "id-does-not-exist-1", "id-does-not-exist-2"));
|
||||
|
||||
var updated = dossierClient.createDossierOrUpdateDossier(cru, auditor).getBody();
|
||||
var updated = dossierClient.createDossierOrUpdateDossier(cru).getBody();
|
||||
assertThat(updated.getDossierName()).isEqualTo(dossierName);
|
||||
assertThat(updated.getPreviewWatermarkId()).isEqualTo(watermarkConfig.getId());
|
||||
assertThat(updated.getReportTemplateIds().size()).isEqualTo(1);
|
||||
@ -384,7 +384,7 @@ public class DossierTest extends AbstractPersistenceServerServiceTest {
|
||||
cru.setPreviewWatermarkId(watermarkConfig.getId());
|
||||
cru.setReportTemplateIds(Set.of(availableTemplates.get(0).getTemplateId(), availableTemplates.get(1).getTemplateId()));
|
||||
|
||||
updated = dossierClient.createDossierOrUpdateDossier(cru, auditor).getBody();
|
||||
updated = dossierClient.createDossierOrUpdateDossier(cru).getBody();
|
||||
assertThat(updated.getDossierName()).isEqualTo(dossierName);
|
||||
assertThat(updated.getPreviewWatermarkId()).isEqualTo(watermarkConfig.getId());
|
||||
assertThat(updated.getReportTemplateIds().size()).isEqualTo(2);
|
||||
@ -404,7 +404,7 @@ public class DossierTest extends AbstractPersistenceServerServiceTest {
|
||||
cru.setPreviewWatermarkId(watermarkConfig.getId());
|
||||
cru.setReportTemplateIds(Set.of(availableTemplates.get(1).getTemplateId(), availableTemplates.get(2).getTemplateId()));
|
||||
|
||||
updated = dossierClient.createDossierOrUpdateDossier(cru, auditor).getBody();
|
||||
updated = dossierClient.createDossierOrUpdateDossier(cru).getBody();
|
||||
assertThat(updated.getDossierName()).isEqualTo(dossierName);
|
||||
assertThat(updated.getPreviewWatermarkId()).isEqualTo(watermarkConfig.getId());
|
||||
assertThat(updated.getReportTemplateIds().size()).isEqualTo(2);
|
||||
@ -424,7 +424,7 @@ public class DossierTest extends AbstractPersistenceServerServiceTest {
|
||||
cru.setPreviewWatermarkId(watermarkConfig.getId());
|
||||
cru.setReportTemplateIds(Set.of(availableTemplates.get(0).getTemplateId()));
|
||||
|
||||
updated = dossierClient.createDossierOrUpdateDossier(cru, auditor).getBody();
|
||||
updated = dossierClient.createDossierOrUpdateDossier(cru).getBody();
|
||||
assertThat(updated.getDossierName()).isEqualTo(dossierName);
|
||||
assertThat(updated.getPreviewWatermarkId()).isEqualTo(watermarkConfig.getId());
|
||||
assertThat(updated.getReportTemplateIds().size()).isEqualTo(1);
|
||||
@ -437,8 +437,8 @@ public class DossierTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(loadedTemplate.getReportTemplateIds()).contains(availableTemplates.get(0).getTemplateId());
|
||||
|
||||
// Remove dossier
|
||||
dossierClient.getDossiers(false, false).forEach(ld -> dossierClient.deleteDossier(ld.getId(), auditor));
|
||||
dossierClient.hardDeleteDossiers(Sets.newHashSet(dossier.getId()), auditor);
|
||||
dossierClient.getDossiers(false, false).forEach(ld -> dossierClient.deleteDossier(ld.getId()));
|
||||
dossierClient.hardDeleteDossiers(Sets.newHashSet(dossier.getId()));
|
||||
assertThat(dossierClient.getDossiers(false, false)).isEmpty();
|
||||
assertThat(dossierClient.getSoftDeletedDossiers()).isEmpty();
|
||||
}
|
||||
@ -450,9 +450,9 @@ public class DossierTest extends AbstractPersistenceServerServiceTest {
|
||||
var template2 = new MockMultipartFile("reportTemplate2.docx","reportTemplate2.docx","application/word" ,new byte[]{1, 2, 3, 4});
|
||||
var template3 = new MockMultipartFile("reportTemplate2.docx","reportTemplate3.docx","application/word" ,new byte[]{1, 2, 3, 4});
|
||||
|
||||
reportTemplateClient.uploadTemplate(template1, dossier.getDossierTemplateId(), true, false, auditor);
|
||||
reportTemplateClient.uploadTemplate(template2, dossier.getDossierTemplateId(), true, false, auditor);
|
||||
reportTemplateClient.uploadTemplate(template3, dossier.getDossierTemplateId(), true, false, auditor);
|
||||
reportTemplateClient.uploadTemplate(template1, dossier.getDossierTemplateId(), true, false);
|
||||
reportTemplateClient.uploadTemplate(template2, dossier.getDossierTemplateId(), true, false);
|
||||
reportTemplateClient.uploadTemplate(template3, dossier.getDossierTemplateId(), true, false);
|
||||
|
||||
var availableTemplates = reportTemplateClient.getAvailableReportTemplates(dossier.getDossierTemplateId());
|
||||
assertThat(availableTemplates.size()).isEqualTo(3);
|
||||
@ -471,16 +471,16 @@ public class DossierTest extends AbstractPersistenceServerServiceTest {
|
||||
var nonDeletedDossiers = dossierClient.getDossiers(true, false);
|
||||
assertThat(nonDeletedDossiers).hasSize(1);
|
||||
|
||||
dossierClient.archiveDossiers(Set.of(dossier1.getId()), auditor);
|
||||
dossierClient.archiveDossiers(Set.of(dossier1.getId()));
|
||||
nonDeletedDossiers = dossierClient.getDossiers(true, false);
|
||||
assertThat(nonDeletedDossiers).hasSize(1);
|
||||
|
||||
dossierClient.deleteDossier(dossier1.getId(), auditor);
|
||||
dossierClient.deleteDossier(dossier1.getId());
|
||||
nonDeletedDossiers = dossierClient.getDossiers(true, false);
|
||||
assertThat(nonDeletedDossiers).hasSize(0);
|
||||
assertThat(dossierClient.getSoftDeletedDossiers()).hasSize(1);
|
||||
|
||||
dossierClient.hardDeleteDossiers(Set.of(dossier1.getId()), auditor);
|
||||
dossierClient.hardDeleteDossiers(Set.of(dossier1.getId()));
|
||||
nonDeletedDossiers = dossierClient.getDossiers(true, false);
|
||||
assertThat(nonDeletedDossiers).hasSize(0);
|
||||
assertThat(dossierClient.getSoftDeletedDossiers()).hasSize(0);
|
||||
@ -500,11 +500,11 @@ public class DossierTest extends AbstractPersistenceServerServiceTest {
|
||||
var archivedAndDeletedDossier = dossierTesterAndProvider.provideTestDossier(template, "archivedAndDeletedDossier");
|
||||
var hardDeletedDossier = dossierTesterAndProvider.provideTestDossier(template, "hardDeletedDossier");
|
||||
|
||||
dossierClient.archiveDossiers(Set.of(onlyArchivedDossier.getId(), archivedAndDeletedDossier.getId()), auditor);
|
||||
dossierClient.deleteDossier(onlyDeletedDossier.getId(), auditor);
|
||||
dossierClient.deleteDossier(archivedAndDeletedDossier.getId(), auditor);
|
||||
dossierClient.deleteDossier(hardDeletedDossier.getId(), auditor);
|
||||
dossierClient.hardDeleteDossiers(Set.of(hardDeletedDossier.getId()), auditor);
|
||||
dossierClient.archiveDossiers(Set.of(onlyArchivedDossier.getId(), archivedAndDeletedDossier.getId()));
|
||||
dossierClient.deleteDossier(onlyDeletedDossier.getId());
|
||||
dossierClient.deleteDossier(archivedAndDeletedDossier.getId());
|
||||
dossierClient.deleteDossier(hardDeletedDossier.getId());
|
||||
dossierClient.hardDeleteDossiers(Set.of(hardDeletedDossier.getId()));
|
||||
|
||||
// check get all dossiers with inclusions
|
||||
assertThat(dossierClient.getDossiers(true, true)).hasSize(4); //all without harddeleted
|
||||
|
||||
@ -111,7 +111,7 @@ public class DownloadPreparationTest extends AbstractPersistenceServerServiceTes
|
||||
.downloadFileTypes(Set.of(DownloadFileType.ORIGINAL))
|
||||
.fileIds(Collections.singletonList(testData.file.getId()))
|
||||
.redactionPreviewColor("#aaaaaa")
|
||||
.build(), auditor);
|
||||
.build());
|
||||
|
||||
List<DownloadStatus> downloadStatuses = downloadClient.getDownloadStatus().getDownloadStatus();
|
||||
assertThat(downloadStatuses).hasSize(1);
|
||||
@ -161,14 +161,14 @@ public class DownloadPreparationTest extends AbstractPersistenceServerServiceTes
|
||||
.dueDate(testData.dossier.getDueDate())
|
||||
.dossierTemplateId(testData.dossier.getDossierTemplateId())
|
||||
.reportTemplateIds(availableTemplates.stream().map(ReportTemplate::getTemplateId).collect(Collectors.toSet()))
|
||||
.build(), auditor);
|
||||
.build());
|
||||
}
|
||||
|
||||
|
||||
private void uploadMockReportTemplate(DossierWithSingleFile testData) {
|
||||
|
||||
var template = new MockMultipartFile("test.docx", "zzz".getBytes());
|
||||
reportTemplateClient.uploadTemplate(template, testData.getDossierTemplateId(), true, true, auditor);
|
||||
reportTemplateClient.uploadTemplate(template, testData.getDossierTemplateId(), true, true);
|
||||
}
|
||||
|
||||
|
||||
@ -222,7 +222,7 @@ public class DownloadPreparationTest extends AbstractPersistenceServerServiceTes
|
||||
|
||||
fileTesterAndProvider.markFileAsProcessed(getFileId());
|
||||
|
||||
fileClient.setStatusApproved(getDossierId(), getFileId(), auditor);
|
||||
fileClient.setStatusApproved(getDossierId(), getFileId());
|
||||
|
||||
assertThatTestFileIsApproved();
|
||||
}
|
||||
|
||||
@ -69,12 +69,12 @@ public class DownloadTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
fileTesterAndProvider.markFileAsProcessed(file2.getFileId());
|
||||
|
||||
fileClient.setStatusApproved(dossier.getId(), file2.getId(), auditor);
|
||||
fileClient.setStatusApproved(dossier.getId(), file2.getId());
|
||||
var file22 = fileClient.getFileStatus(dossier.getId(), file2.getId());
|
||||
assertThat(file22.getWorkflowStatus()).isEqualTo(WorkflowStatus.APPROVED);
|
||||
|
||||
try {
|
||||
downloadClient.prepareDownload(PrepareDownloadRequest.builder().dossierId(dossier.getId()).fileIds(List.of(file.getId(), file2.getId())).build(), auditor);
|
||||
downloadClient.prepareDownload(PrepareDownloadRequest.builder().dossierId(dossier.getId()).fileIds(List.of(file.getId(), file2.getId())).build());
|
||||
} catch (FeignException e) {
|
||||
assertThat(e.status()).isEqualTo(400);
|
||||
}
|
||||
@ -83,7 +83,7 @@ public class DownloadTest extends AbstractPersistenceServerServiceTest {
|
||||
.downloadFileTypes(Set.of(DownloadFileType.ORIGINAL))
|
||||
.dossierId(dossier.getId())
|
||||
.fileIds(List.of(file2.getId()))
|
||||
.build(), auditor);
|
||||
.build());
|
||||
|
||||
downloadMessageReceiver.receive(new DownloadJob(userProvider.getUserId(), downloads.getStorageId()));
|
||||
var reportInfoId = downloads.getStorageId().substring(0, downloads.getStorageId().length() - 3) + "/REPORT_INFO.json";
|
||||
@ -98,7 +98,7 @@ public class DownloadTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(statuses.getDownloadStatus()).isNotEmpty();
|
||||
assertThat(statuses.getDownloadStatus().iterator().next().getLastDownload()).isNull();
|
||||
|
||||
downloadClient.deleteDownloadStatus(new RemoveDownloadRequest(List.of(statuses.getDownloadStatus().iterator().next().getStorageId())), auditor);
|
||||
downloadClient.deleteDownloadStatus(new RemoveDownloadRequest(List.of(statuses.getDownloadStatus().iterator().next().getStorageId())));
|
||||
statuses = downloadClient.getDownloadStatus();
|
||||
assertThat(statuses.getDownloadStatus()).isEmpty();
|
||||
|
||||
|
||||
@ -67,13 +67,13 @@ public class FileAttributeTest extends AbstractPersistenceServerServiceTest {
|
||||
generalConfig.setEncoding("UTF-8");
|
||||
generalConfig.setFilenameMappingColumnHeaderName("Name");
|
||||
|
||||
fileAttributeConfigClient.setFileAttributesConfig(dossier.getDossierTemplateId(), generalConfig, auditor);
|
||||
fileAttributeConfigClient.setFileAttributesConfig(dossier.getDossierTemplateId(), generalConfig);
|
||||
var loadedConfig = fileAttributeConfigClient.getFileAttributesConfiguration(dossier.getDossierTemplateId());
|
||||
assertThat(loadedConfig.getDelimiter()).isEqualTo(",");
|
||||
assertThat(loadedConfig.getEncoding()).isEqualTo(UTF_ENCODING);
|
||||
|
||||
generalConfig.setEncoding(" ASCII ");
|
||||
fileAttributeConfigClient.setFileAttributesConfig(dossier.getDossierTemplateId(), generalConfig, auditor);
|
||||
fileAttributeConfigClient.setFileAttributesConfig(dossier.getDossierTemplateId(), generalConfig);
|
||||
loadedConfig = fileAttributeConfigClient.getFileAttributesConfiguration(dossier.getDossierTemplateId());
|
||||
assertThat(loadedConfig.getEncoding()).isEqualTo(ASCII_ENCODING);
|
||||
|
||||
@ -85,7 +85,7 @@ public class FileAttributeTest extends AbstractPersistenceServerServiceTest {
|
||||
configs.add(FileAttributeConfig.builder().csvColumnHeader("Attribute C").primaryAttribute(false).label("Attribute C").build());
|
||||
configs.add(FileAttributeConfig.builder().csvColumnHeader("Attribute D").primaryAttribute(false).label("Attribute D").build());
|
||||
|
||||
fileAttributeConfigClient.setFileAttributesConfig(dossier.getDossierTemplateId(), new FileAttributesConfig("Name", ",", UTF_ENCODING, configs), auditor);
|
||||
fileAttributeConfigClient.setFileAttributesConfig(dossier.getDossierTemplateId(), new FileAttributesConfig("Name", ",", UTF_ENCODING, configs));
|
||||
|
||||
List<FileAttributeConfig> loadedConfigs = fileAttributeConfigClient.getFileAttributesConfiguration(dossier.getDossierTemplateId()).getFileAttributeConfigs();
|
||||
assertThat(loadedConfigs.size()).isEqualTo(5);
|
||||
@ -97,7 +97,7 @@ public class FileAttributeTest extends AbstractPersistenceServerServiceTest {
|
||||
.filter(a -> a.getCsvColumnHeader().equalsIgnoreCase("Attribute C"))
|
||||
.findAny()
|
||||
.map(FileAttributeConfig::getId)
|
||||
.orElseThrow(() -> new IllegalArgumentException("Should exists!")), auditor);
|
||||
.orElseThrow(() -> new IllegalArgumentException("Should exists!")));
|
||||
|
||||
fileAttributeConfigClient.deleteFileAttributes(dossier.getDossierTemplateId(),
|
||||
loadedConfigs.stream()
|
||||
@ -105,7 +105,7 @@ public class FileAttributeTest extends AbstractPersistenceServerServiceTest {
|
||||
.findAny()
|
||||
.map(FileAttributeConfig::getId)
|
||||
.stream()
|
||||
.collect(Collectors.toList()), auditor);
|
||||
.collect(Collectors.toList()));
|
||||
|
||||
loadedConfigs = fileAttributeConfigClient.getFileAttributesConfiguration(dossier.getDossierTemplateId()).getFileAttributeConfigs();
|
||||
assertThat(loadedConfigs.size()).isEqualTo(3);
|
||||
@ -113,20 +113,20 @@ public class FileAttributeTest extends AbstractPersistenceServerServiceTest {
|
||||
FileAttributeConfig newConfig = new FileAttributeConfig();
|
||||
newConfig.setPrimaryAttribute(true);
|
||||
newConfig.setLabel("Test Attribute");
|
||||
var created = fileAttributeConfigClient.addOrUpdateFileAttribute(dossier.getDossierTemplateId(), newConfig, auditor);
|
||||
var created = fileAttributeConfigClient.addOrUpdateFileAttribute(dossier.getDossierTemplateId(), newConfig);
|
||||
loadedConfigs = fileAttributeConfigClient.getFileAttributesConfiguration(dossier.getDossierTemplateId()).getFileAttributeConfigs();
|
||||
assertThat(loadedConfigs.size()).isEqualTo(4);
|
||||
|
||||
newConfig.setId(created.getId());
|
||||
newConfig.setLabel("Test Attribute Update");
|
||||
var updated = fileAttributeConfigClient.addOrUpdateFileAttribute(dossier.getDossierTemplateId(), newConfig, auditor);
|
||||
var updated = fileAttributeConfigClient.addOrUpdateFileAttribute(dossier.getDossierTemplateId(), newConfig);
|
||||
loadedConfigs = fileAttributeConfigClient.getFileAttributesConfiguration(dossier.getDossierTemplateId()).getFileAttributeConfigs();
|
||||
assertThat(loadedConfigs.size()).isEqualTo(4);
|
||||
assertThat(updated.getLabel()).isEqualTo("Test Attribute Update");
|
||||
|
||||
assertThat(fileClient.getFileStatus(dossier.getId(), file.getId()).getLastFileAttributeChange()).isNull();
|
||||
|
||||
fileAttributeClient.setFileAttributes(dossier.getId(), file.getId(), new FileAttributes(Map.of(updated.getId(), "Lorem Ipsum")), auditor);
|
||||
fileAttributeClient.setFileAttributes(dossier.getId(), file.getId(), new FileAttributes(Map.of(updated.getId(), "Lorem Ipsum")));
|
||||
|
||||
assertThat(fileClient.getFileStatus(dossier.getId(), file.getId()).getLastFileAttributeChange()).isNotNull();
|
||||
|
||||
@ -134,7 +134,7 @@ public class FileAttributeTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(fileAttributes.size()).isEqualTo(1);
|
||||
assertThat(fileAttributes.entrySet().iterator().next().getValue()).isEqualTo("Lorem Ipsum");
|
||||
|
||||
fileAttributeClient.setFileAttributes(dossier.getId(), file.getId(), new FileAttributes(Map.of(updated.getId(), " ")), auditor);
|
||||
fileAttributeClient.setFileAttributes(dossier.getId(), file.getId(), new FileAttributes(Map.of(updated.getId(), " ")));
|
||||
|
||||
fileAttributes = fileClient.getFileStatus(dossier.getId(), file.getId()).getFileAttributes().getAttributeIdToValue();
|
||||
assertThat(fileAttributes.size()).isEqualTo(1);
|
||||
@ -142,7 +142,7 @@ public class FileAttributeTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
Map<String, String> fileAttributesWithNullValue = new HashMap<>();
|
||||
fileAttributesWithNullValue.put(updated.getId(), null);
|
||||
fileAttributeClient.setFileAttributes(dossier.getId(), file.getId(), new FileAttributes(fileAttributesWithNullValue), auditor);
|
||||
fileAttributeClient.setFileAttributes(dossier.getId(), file.getId(), new FileAttributes(fileAttributesWithNullValue));
|
||||
|
||||
fileAttributes = fileClient.getFileStatus(dossier.getId(), file.getId()).getFileAttributes().getAttributeIdToValue();
|
||||
assertThat(fileAttributes.size()).isEqualTo(1);
|
||||
@ -155,12 +155,12 @@ public class FileAttributeTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(fileAttributes.size()).isEqualTo(2);
|
||||
|
||||
fileAttributes.put(fileAttributes.keySet().iterator().next(), "changed");
|
||||
fileAttributeClient.setFileAttributes(dossier.getId(), file.getId(), new FileAttributes(fileAttributes), auditor);
|
||||
fileAttributeClient.setFileAttributes(dossier.getId(), file.getId(), new FileAttributes(fileAttributes));
|
||||
|
||||
fileAttributes = fileClient.getFileStatus(dossier.getId(), file.getId()).getFileAttributes().getAttributeIdToValue();
|
||||
assertThat(fileAttributes.size()).isEqualTo(2);
|
||||
|
||||
fileAttributeConfigClient.setFileAttributesConfig(dossier.getDossierTemplateId(), new FileAttributesConfig("Name",",","ASCII",new ArrayList<>()), auditor);
|
||||
fileAttributeConfigClient.setFileAttributesConfig(dossier.getDossierTemplateId(), new FileAttributesConfig("Name",",","ASCII",new ArrayList<>()));
|
||||
|
||||
loadedConfigs = fileAttributeConfigClient.getFileAttributesConfiguration(dossier.getDossierTemplateId()).getFileAttributeConfigs();
|
||||
assertThat(loadedConfigs.size()).isEqualTo(0);
|
||||
@ -182,7 +182,7 @@ public class FileAttributeTest extends AbstractPersistenceServerServiceTest {
|
||||
generalConfig.setEncoding("UTF-8");
|
||||
generalConfig.setFilenameMappingColumnHeaderName("Name");
|
||||
|
||||
fileAttributeConfigClient.setFileAttributesConfig(dossier.getDossierTemplateId(), generalConfig, auditor);
|
||||
fileAttributeConfigClient.setFileAttributesConfig(dossier.getDossierTemplateId(), generalConfig);
|
||||
var loadedConfig = fileAttributeConfigClient.getFileAttributesConfiguration(dossier.getDossierTemplateId());
|
||||
assertThat(loadedConfig.getDelimiter()).isEqualTo(",");
|
||||
|
||||
@ -195,20 +195,20 @@ public class FileAttributeTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
generalConfig.setFileAttributeConfigs(configs);
|
||||
|
||||
fileAttributeConfigClient.setFileAttributesConfig(dossier.getDossierTemplateId(), generalConfig, auditor);
|
||||
fileAttributeConfigClient.setFileAttributesConfig(dossier.getDossierTemplateId(), generalConfig);
|
||||
|
||||
List<FileAttributeConfig> loadedConfigs = fileAttributeConfigClient.getFileAttributesConfiguration(dossier.getDossierTemplateId()).getFileAttributeConfigs();
|
||||
assertThat(loadedConfigs.size()).isEqualTo(5);
|
||||
|
||||
fileAttributeClient.setFileAttributes(dossier.getId(), file.getId(), new FileAttributes(Map.of(loadedConfigs.get(0).getId(), "Lorem Ipsum")), auditor);
|
||||
fileAttributeClient.setFileAttributes(dossier.getId(), file.getId(), new FileAttributes(Map.of(loadedConfigs.get(0).getId(), "Lorem Ipsum")));
|
||||
|
||||
Map<String, String> fileAttributes = fileClient.getFileStatus(dossier.getId(), file.getId()).getFileAttributes().getAttributeIdToValue();
|
||||
assertThat(fileAttributes.size()).isEqualTo(1);
|
||||
assertThat(fileAttributes.entrySet().iterator().next().getValue()).isEqualTo("Lorem Ipsum");
|
||||
|
||||
// Delete file
|
||||
fileManagementClient.deleteFile(dossier.getId(), file.getId(), auditor);
|
||||
fileManagementClient.hardDeleteFiles(dossier.getId(), Sets.newHashSet(file.getId()), auditor);
|
||||
fileManagementClient.deleteFile(dossier.getId(), file.getId());
|
||||
fileManagementClient.hardDeleteFiles(dossier.getId(), Sets.newHashSet(file.getId()));
|
||||
var deletedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(deletedFile.getFileAttributes().getAttributeIdToValue()).isEmpty();
|
||||
|
||||
|
||||
@ -119,7 +119,7 @@ public class FileProcessingTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(loadedFile.getAnalysisVersion()).isEqualTo(0);
|
||||
|
||||
// Delete file
|
||||
fileManagementClient.deleteFile(dossier.getId(), file.getId(), auditor);
|
||||
fileManagementClient.deleteFile(dossier.getId(), file.getId());
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
// assertThat(loadedFile.getProcessingStatus()).isEqualTo(ProcessingStatus.DELETED);
|
||||
assertThat(loadedFile.getSoftDeletedTime()).isNotNull();
|
||||
@ -155,7 +155,7 @@ public class FileProcessingTest extends AbstractPersistenceServerServiceTest {
|
||||
var file = fileTesterAndProvider.testAndProvideFile(dossier);
|
||||
|
||||
var userId = userProvider.getUserId();
|
||||
fileClient.setStatusUnderReview(dossier.getId(), file.getId(), userId, auditor);
|
||||
fileClient.setStatusUnderReview(dossier.getId(), file.getId(), userId);
|
||||
|
||||
fileProcessingClient.analysisSuccessful(dossier.getId(),
|
||||
file.getId(),
|
||||
@ -165,9 +165,9 @@ public class FileProcessingTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
|
||||
|
||||
reanalysisClient.toggleExclusion(file.getDossierId(), file.getId(), true, auditor);
|
||||
reanalysisClient.toggleExclusion(file.getDossierId(), file.getId(), true);
|
||||
|
||||
reanalysisClient.toggleExclusion(file.getDossierId(), file.getId(), false, auditor);
|
||||
reanalysisClient.toggleExclusion(file.getDossierId(), file.getId(), false);
|
||||
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
|
||||
@ -190,7 +190,7 @@ public class FileProcessingTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(loadedFile.getProcessingStatus()).isEqualTo(ProcessingStatus.PROCESSED);
|
||||
|
||||
// Delete file
|
||||
fileManagementClient.deleteFile(dossier.getId(), file.getId(), auditor);
|
||||
fileManagementClient.deleteFile(dossier.getId(), file.getId());
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getSoftDeletedTime()).isNotNull();
|
||||
|
||||
@ -213,7 +213,7 @@ public class FileProcessingTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(loadedFile.getFileErrorInfo()).isNotNull();
|
||||
assertThat(loadedFile.getFileErrorInfo().getCause()).isEqualTo("analysisFailed");
|
||||
|
||||
reanalysisClient.reanalyzeFilesForDossier(dossier.getId(), List.of(loadedFile.getId()), true, auditor);
|
||||
reanalysisClient.reanalyzeFilesForDossier(dossier.getId(), List.of(loadedFile.getId()), true);
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getProcessingStatus()).isEqualTo(ProcessingStatus.FULL_PROCESSING);
|
||||
|
||||
|
||||
@ -130,7 +130,7 @@ public class FileTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(fileClient.getDossierStatus(dossier.getId()).size()).isEqualTo(1);
|
||||
var loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
|
||||
fileManagementClient.deleteFile(dossier.getId(), file.getId(), auditor);
|
||||
fileManagementClient.deleteFile(dossier.getId(), file.getId());
|
||||
|
||||
var nrOfFiles = fileClient.getSoftDeletedDossierStatus(dossier.getId()).size();
|
||||
assertThat(nrOfFiles).isEqualTo(1);
|
||||
@ -155,14 +155,14 @@ public class FileTest extends AbstractPersistenceServerServiceTest {
|
||||
var loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
|
||||
var userId = userProvider.getUserId();
|
||||
fileClient.setStatusUnderApproval(dossier.getId(), file.getId(), userId, auditor);
|
||||
reanalysisClient.toggleAutomaticAnalysis(dossier.getId(), file.getId(), true, auditor);
|
||||
fileClient.setStatusUnderApproval(dossier.getId(), file.getId(), userId);
|
||||
reanalysisClient.toggleAutomaticAnalysis(dossier.getId(), file.getId(), true);
|
||||
|
||||
List<FileAttributeConfig> configs = new ArrayList<>();
|
||||
configs.add(FileAttributeConfig.builder().csvColumnHeader("Name").primaryAttribute(true).label("Name").build());
|
||||
configs.add(FileAttributeConfig.builder().csvColumnHeader("Attribute A").primaryAttribute(true).label("Attribute A").build());
|
||||
var loadedConfig = fileAttributeConfigClient.setFileAttributesConfig(dossier.getDossierTemplateId(), new FileAttributesConfig(configs), auditor);
|
||||
fileAttributeClient.setFileAttributes(dossier.getId(), file.getId(), new FileAttributes(Map.of(loadedConfig.getFileAttributeConfigs().get(0).getId(), "123")), auditor);
|
||||
var loadedConfig = fileAttributeConfigClient.setFileAttributesConfig(dossier.getDossierTemplateId(), new FileAttributesConfig(configs));
|
||||
fileAttributeClient.setFileAttributes(dossier.getId(), file.getId(), new FileAttributes(Map.of(loadedConfig.getFileAttributeConfigs().get(0).getId(), "123")));
|
||||
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.isExcludedFromAutomaticAnalysis()).isTrue();
|
||||
@ -181,7 +181,7 @@ public class FileTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(loadedFile.isExcludedFromAutomaticAnalysis()).isFalse();
|
||||
assertThat(loadedFile.getFileAttributes().getAttributeIdToValue()).size().isEqualTo(0);
|
||||
|
||||
fileClient.setStatusUnderReview(dossier.getId(), file.getId(), userId, auditor);
|
||||
fileClient.setStatusUnderReview(dossier.getId(), file.getId(), userId);
|
||||
|
||||
viewedPages = viewedPagesClient.getViewedPages(file.getDossierId(), file.getFileId());
|
||||
assertThat(viewedPages.getPages().size()).isEqualTo(0);
|
||||
@ -197,15 +197,15 @@ public class FileTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
var file = fileTesterAndProvider.testAndProvideFile(dossier, filename);
|
||||
|
||||
fileClient.setStatusUnderReview(dossier.getId(), file.getId(), userId, auditor);
|
||||
reanalysisClient.excludePages(dossier.getId(), file.getId(), new PageExclusionRequest(List.of(new PageRange(1, 1))), auditor);
|
||||
fileClient.setStatusUnderReview(dossier.getId(), file.getId(), userId);
|
||||
reanalysisClient.excludePages(dossier.getId(), file.getId(), new PageExclusionRequest(List.of(new PageRange(1, 1))));
|
||||
var redactionLog = redactionLogClient.getRedactionLog(dossier.getId(), file.getId(), null, false, true);
|
||||
|
||||
assertThat(fileClient.getDossierStatus(dossier.getId()).size()).isEqualTo(1);
|
||||
var loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
|
||||
fileClient.setStatusUnderApproval(dossier.getId(), file.getId(), userId, auditor);
|
||||
reanalysisClient.toggleAutomaticAnalysis(dossier.getId(), file.getId(), true, auditor);
|
||||
fileClient.setStatusUnderApproval(dossier.getId(), file.getId(), userId);
|
||||
reanalysisClient.toggleAutomaticAnalysis(dossier.getId(), file.getId(), true);
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.isExcludedFromAutomaticAnalysis()).isTrue();
|
||||
|
||||
@ -243,36 +243,36 @@ public class FileTest extends AbstractPersistenceServerServiceTest {
|
||||
var loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getFileManipulationDate()).isNotNull();
|
||||
|
||||
fileClient.setCurrentFileAssignee(dossier.getId(), file.getId(), userId, auditor);
|
||||
fileClient.setCurrentFileAssignee(dossier.getId(), file.getId(), userId);
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getAssignee()).isEqualTo(userId);
|
||||
assertThat(loadedFile.getWorkflowStatus()).isEqualTo(WorkflowStatus.NEW);
|
||||
assertThat(loadedFile.getLastReviewer()).isNull();
|
||||
assertThat(loadedFile.getLastApprover()).isNull();
|
||||
|
||||
reanalysisClient.excludePages(dossier.getId(), file.getId(), new PageExclusionRequest(List.of(new PageRange(1, 1))), auditor);
|
||||
reanalysisClient.excludePages(dossier.getId(), file.getId(), new PageExclusionRequest(List.of(new PageRange(1, 1))));
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getExcludedPages()).containsExactlyInAnyOrder(1);
|
||||
|
||||
reanalysisClient.includePages(dossier.getId(), file.getId(), new PageExclusionRequest(List.of(new PageRange(1, 1))), auditor);
|
||||
reanalysisClient.includePages(dossier.getId(), file.getId(), new PageExclusionRequest(List.of(new PageRange(1, 1))));
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getExcludedPages()).isEmpty();
|
||||
|
||||
fileClient.setCurrentFileAssignee(dossier.getId(), file.getId(), userId, auditor);
|
||||
fileClient.setCurrentFileAssignee(dossier.getId(), file.getId(), userId);
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getAssignee()).isEqualTo(userId);
|
||||
assertThat(loadedFile.getWorkflowStatus()).isEqualTo(WorkflowStatus.NEW);
|
||||
assertThat(loadedFile.getLastReviewer()).isNull();
|
||||
assertThat(loadedFile.getLastApprover()).isNull();
|
||||
|
||||
fileClient.setStatusUnderReview(dossier.getId(), file.getId(), null, auditor);
|
||||
fileClient.setStatusUnderReview(dossier.getId(), file.getId(), null);
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getWorkflowStatus()).isEqualTo(WorkflowStatus.UNDER_REVIEW);
|
||||
assertThat(loadedFile.getAssignee()).isEqualTo(userId);
|
||||
assertThat(loadedFile.getLastReviewer()).isEqualTo(userId);
|
||||
assertThat(loadedFile.getLastApprover()).isNull();
|
||||
|
||||
fileClient.setStatusUnderApproval(dossier.getId(), file.getId(), userId, auditor);
|
||||
fileClient.setStatusUnderApproval(dossier.getId(), file.getId(), userId);
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getWorkflowStatus()).isEqualTo(WorkflowStatus.UNDER_APPROVAL);
|
||||
assertThat(loadedFile.getAssignee()).isEqualTo(userId);
|
||||
@ -280,7 +280,7 @@ public class FileTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(loadedFile.getLastApprover()).isEqualTo(userId);
|
||||
|
||||
fileTesterAndProvider.markFileAsProcessed(file.getFileId());
|
||||
fileClient.setStatusApproved(dossier.getId(), file.getId(), auditor);
|
||||
fileClient.setStatusApproved(dossier.getId(), file.getId());
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getWorkflowStatus()).isEqualTo(WorkflowStatus.APPROVED);
|
||||
assertThat(loadedFile.getAssignee()).isEqualTo(userId);
|
||||
@ -288,7 +288,7 @@ public class FileTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(loadedFile.getLastApprover()).isEqualTo(userId);
|
||||
assertThat(loadedFile.isExcludedFromAutomaticAnalysis()).isTrue();
|
||||
|
||||
fileClient.setStatusUnderReview(dossier.getId(), file.getId(), altUserId, auditor);
|
||||
fileClient.setStatusUnderReview(dossier.getId(), file.getId(), altUserId);
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getWorkflowStatus()).isEqualTo(WorkflowStatus.UNDER_REVIEW);
|
||||
assertThat(loadedFile.getAssignee()).isEqualTo(altUserId);
|
||||
@ -296,44 +296,44 @@ public class FileTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(loadedFile.getLastApprover()).isEqualTo(userId);
|
||||
assertThat(loadedFile.isExcludedFromAutomaticAnalysis()).isTrue();
|
||||
|
||||
fileClient.setStatusUnderApproval(dossier.getId(), file.getId(), altUserId, auditor);
|
||||
fileClient.setStatusUnderApproval(dossier.getId(), file.getId(), altUserId);
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getWorkflowStatus()).isEqualTo(WorkflowStatus.UNDER_APPROVAL);
|
||||
assertThat(loadedFile.getAssignee()).isEqualTo(altUserId);
|
||||
assertThat(loadedFile.getLastReviewer()).isEqualTo(userId);
|
||||
assertThat(loadedFile.getLastApprover()).isEqualTo(altUserId);
|
||||
|
||||
fileClient.setStatusApproved(dossier.getId(), file.getId(), auditor);
|
||||
fileClient.setStatusApproved(dossier.getId(), file.getId());
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getWorkflowStatus()).isEqualTo(WorkflowStatus.APPROVED);
|
||||
assertThat(loadedFile.getAssignee()).isEqualTo(userId);
|
||||
assertThat(loadedFile.getLastReviewer()).isEqualTo(userId);
|
||||
assertThat(loadedFile.getLastApprover()).isEqualTo(altUserId);
|
||||
|
||||
fileClient.setStatusUnderReview(dossier.getId(), file.getId(), null, auditor);
|
||||
fileClient.setStatusUnderReview(dossier.getId(), file.getId(), null);
|
||||
|
||||
reanalysisClient.toggleExclusion(dossier.getId(), file.getId(), true, auditor);
|
||||
reanalysisClient.toggleExclusion(dossier.getId(), file.getId(), true);
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.isExcluded()).isTrue();
|
||||
|
||||
reanalysisClient.toggleExclusion(dossier.getId(), file.getId(), false, auditor);
|
||||
reanalysisClient.toggleExclusion(dossier.getId(), file.getId(), false);
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.isExcluded()).isFalse();
|
||||
|
||||
fileManagementClient.deleteFile(dossier.getId(), file.getId(), auditor);
|
||||
fileManagementClient.deleteFile(dossier.getId(), file.getId());
|
||||
|
||||
var softDeletedFiles = fileClient.getSoftDeletedDossierStatus(dossier.getId());
|
||||
assertThat(softDeletedFiles.size()).isEqualTo(1);
|
||||
var activeFiles = fileClient.getDossierStatus(dossier.getId());
|
||||
assertThat(activeFiles.size()).isEqualTo(0);
|
||||
|
||||
fileManagementClient.restoreFiles(dossier.getId(), Sets.newHashSet(file.getId()), auditor);
|
||||
fileManagementClient.restoreFiles(dossier.getId(), Sets.newHashSet(file.getId()));
|
||||
softDeletedFiles = fileClient.getSoftDeletedDossierStatus(dossier.getId());
|
||||
assertThat(softDeletedFiles.size()).isEqualTo(0);
|
||||
activeFiles = fileClient.getDossierStatus(dossier.getId());
|
||||
assertThat(activeFiles.size()).isEqualTo(1);
|
||||
|
||||
fileManagementClient.hardDeleteFiles(dossier.getId(), Sets.newHashSet(file.getId()), auditor);
|
||||
fileManagementClient.hardDeleteFiles(dossier.getId(), Sets.newHashSet(file.getId()));
|
||||
softDeletedFiles = fileClient.getSoftDeletedDossierStatus(dossier.getId());
|
||||
assertThat(softDeletedFiles.size()).isEqualTo(0);
|
||||
|
||||
@ -374,36 +374,36 @@ public class FileTest extends AbstractPersistenceServerServiceTest {
|
||||
.legalBasis("1")
|
||||
.dictionaryEntryType(DictionaryEntryType.ENTRY)
|
||||
.build();
|
||||
manualRedactionClient.addRedactionBulk(dossierId, fileId, Set.of(addRedactionRequest), auditor);
|
||||
manualRedactionClient.addRedactionBulk(dossierId, fileId, Set.of(addRedactionRequest));
|
||||
|
||||
manualRedactionClient.removeRedactionBulk(dossierId,
|
||||
fileId,
|
||||
Set.of(RemoveRedactionRequestModel.builder().annotationId(annotationId).comment("comment").removeFromDictionary(false).build()), auditor);
|
||||
Set.of(RemoveRedactionRequestModel.builder().annotationId(annotationId).comment("comment").removeFromDictionary(false).build()));
|
||||
manualRedactionClient.forceRedactionBulk(dossierId,
|
||||
fileId,
|
||||
Set.of(ForceRedactionRequestModel.builder().annotationId("forceRedactionAnnotation").comment("comment").legalBasis("1").build()), auditor);
|
||||
Set.of(ForceRedactionRequestModel.builder().annotationId("forceRedactionAnnotation").comment("comment").legalBasis("1").build()));
|
||||
manualRedactionClient.legalBasisChangeBulk(dossierId,
|
||||
fileId,
|
||||
Set.of(LegalBasisChangeRequestModel.builder().annotationId("legalBasisChangeAnnotation").comment("comment").legalBasis("1").build()), auditor);
|
||||
Set.of(LegalBasisChangeRequestModel.builder().annotationId("legalBasisChangeAnnotation").comment("comment").legalBasis("1").build()));
|
||||
manualRedactionClient.recategorizeBulk(dossierId,
|
||||
fileId,
|
||||
Set.of(RecategorizationRequestModel.builder().annotationId(annotationId).comment("comment").type("new-type").build()), auditor);
|
||||
Set.of(RecategorizationRequestModel.builder().annotationId(annotationId).comment("comment").type("new-type").build()));
|
||||
|
||||
var loadedFile = fileClient.getFileStatus(dossierId, fileId);
|
||||
|
||||
fileManagementClient.deleteFile(dossier.getId(), file.getId(), auditor);
|
||||
fileManagementClient.deleteFile(dossier.getId(), file.getId());
|
||||
var softDeletedFiles = fileClient.getSoftDeletedDossierStatus(dossier.getId());
|
||||
assertThat(softDeletedFiles.size()).isEqualTo(1);
|
||||
var activeFiles = fileClient.getDossierStatus(dossier.getId());
|
||||
assertThat(activeFiles.size()).isEqualTo(0);
|
||||
|
||||
fileManagementClient.restoreFiles(dossier.getId(), Sets.newHashSet(file.getId()), auditor);
|
||||
fileManagementClient.restoreFiles(dossier.getId(), Sets.newHashSet(file.getId()));
|
||||
softDeletedFiles = fileClient.getSoftDeletedDossierStatus(dossier.getId());
|
||||
assertThat(softDeletedFiles.size()).isEqualTo(0);
|
||||
activeFiles = fileClient.getDossierStatus(dossier.getId());
|
||||
assertThat(activeFiles.size()).isEqualTo(1);
|
||||
|
||||
fileManagementClient.hardDeleteFiles(dossier.getId(), Sets.newHashSet(file.getId()), auditor);
|
||||
fileManagementClient.hardDeleteFiles(dossier.getId(), Sets.newHashSet(file.getId()));
|
||||
softDeletedFiles = fileClient.getSoftDeletedDossierStatus(dossier.getId());
|
||||
assertThat(softDeletedFiles.size()).isEqualTo(0);
|
||||
|
||||
@ -430,7 +430,7 @@ public class FileTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
var userId = userProvider.getUserId();
|
||||
|
||||
fileClient.setStatusUnderReview(dossier.getId(), file.getId(), userId, auditor);
|
||||
fileClient.setStatusUnderReview(dossier.getId(), file.getId(), userId);
|
||||
|
||||
var addRedaction = manualRedactionClient.addRedactionBulk(dossierId,
|
||||
fileId,
|
||||
@ -443,15 +443,15 @@ public class FileTest extends AbstractPersistenceServerServiceTest {
|
||||
.value("test")
|
||||
.legalBasis("1")
|
||||
.dictionaryEntryType(DictionaryEntryType.ENTRY)
|
||||
.build()), auditor).iterator().next();
|
||||
.build())).iterator().next();
|
||||
|
||||
var loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
|
||||
reanalysisClient.toggleExclusion(dossier.getId(), file.getId(), true, auditor);
|
||||
reanalysisClient.toggleExclusion(dossier.getId(), file.getId(), true);
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.isExcluded()).isTrue();
|
||||
|
||||
reanalysisClient.toggleExclusion(dossier.getId(), file.getId(), false, auditor);
|
||||
reanalysisClient.toggleExclusion(dossier.getId(), file.getId(), false);
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.isExcluded()).isFalse();
|
||||
}
|
||||
@ -474,18 +474,18 @@ public class FileTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
assertThat(fileClient.getDossierStatus(dossier.getId()).size()).isEqualTo(1);
|
||||
|
||||
reanalysisClient.excludePages(dossierId, fileId, new PageExclusionRequest(List.of(new PageRange(1, 1))), auditor);
|
||||
reanalysisClient.excludePages(dossierId, fileId, new PageExclusionRequest(List.of(new PageRange(1, 1))));
|
||||
assertThat(fileClient.getFileStatus(dossierId, fileId).getExcludedPages().size()).isEqualTo(1);
|
||||
assertThat(fileClient.getFileStatus(dossierId, fileId).getExcludedPages()).contains(1);
|
||||
|
||||
// Delete file
|
||||
fileManagementClient.deleteFile(dossierId, fileId, auditor);
|
||||
fileManagementClient.deleteFile(dossierId, fileId);
|
||||
var softDeletedFiles = fileClient.getSoftDeletedDossierStatus(dossierId);
|
||||
assertThat(softDeletedFiles.size()).isEqualTo(1);
|
||||
var activeFiles = fileClient.getDossierStatus(dossierId);
|
||||
assertThat(activeFiles.size()).isEqualTo(0);
|
||||
|
||||
fileManagementClient.hardDeleteFiles(dossierId, Sets.newHashSet(fileId), auditor);
|
||||
fileManagementClient.hardDeleteFiles(dossierId, Sets.newHashSet(fileId));
|
||||
softDeletedFiles = fileClient.getSoftDeletedDossierStatus(dossierId);
|
||||
assertThat(softDeletedFiles.size()).isEqualTo(0);
|
||||
|
||||
@ -516,28 +516,28 @@ public class FileTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(loadedFile.getLastReviewer()).isNull();
|
||||
assertThat(loadedFile.getLastApprover()).isNull();
|
||||
|
||||
fileClient.setStatusUnderReview(dossier.getId(), file.getId(), userId, auditor);
|
||||
fileClient.setStatusUnderReview(dossier.getId(), file.getId(), userId);
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getWorkflowStatus()).isEqualTo(WorkflowStatus.UNDER_REVIEW);
|
||||
assertThat(loadedFile.getAssignee()).isEqualTo(userId);
|
||||
assertThat(loadedFile.getLastReviewer()).isNull();
|
||||
assertThat(loadedFile.getLastApprover()).isNull();
|
||||
|
||||
fileClient.setCurrentFileAssignee(dossier.getId(), file.getId(), altUserId, auditor);
|
||||
fileClient.setCurrentFileAssignee(dossier.getId(), file.getId(), altUserId);
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getWorkflowStatus()).isEqualTo(WorkflowStatus.UNDER_REVIEW);
|
||||
assertThat(loadedFile.getAssignee()).isEqualTo(altUserId);
|
||||
assertThat(loadedFile.getLastReviewer()).isEqualTo(userId);
|
||||
assertThat(loadedFile.getLastApprover()).isNull();
|
||||
|
||||
fileClient.setStatusUnderApproval(dossier.getId(), file.getId(), altUserId, auditor);
|
||||
fileClient.setStatusUnderApproval(dossier.getId(), file.getId(), altUserId);
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getWorkflowStatus()).isEqualTo(WorkflowStatus.UNDER_APPROVAL);
|
||||
assertThat(loadedFile.getAssignee()).isEqualTo(altUserId);
|
||||
assertThat(loadedFile.getLastReviewer()).isEqualTo(userId);
|
||||
assertThat(loadedFile.getLastApprover()).isEqualTo(altUserId);
|
||||
|
||||
fileClient.setCurrentFileAssignee(dossier.getId(), file.getId(), userId, auditor);
|
||||
fileClient.setCurrentFileAssignee(dossier.getId(), file.getId(), userId);
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getWorkflowStatus()).isEqualTo(WorkflowStatus.UNDER_APPROVAL);
|
||||
assertThat(loadedFile.getAssignee()).isEqualTo(userId);
|
||||
@ -566,7 +566,7 @@ public class FileTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(loadedFile.getLastApprover()).isNull();
|
||||
|
||||
Exception exception = Assertions.assertThrows(FeignException.BadRequest.class, () -> {
|
||||
fileClient.setStatusUnderReview(dossier.getId(), file.getId(), null, auditor);
|
||||
fileClient.setStatusUnderReview(dossier.getId(), file.getId(), null);
|
||||
});
|
||||
|
||||
String expectedMessage = "File is already unassigned!";
|
||||
@ -575,7 +575,7 @@ public class FileTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(actualMessage).contains(expectedMessage);
|
||||
|
||||
exception = Assertions.assertThrows(FeignException.BadRequest.class, () -> {
|
||||
fileClient.setStatusUnderReview(dossier.getId(), file.getId(), user2, auditor);
|
||||
fileClient.setStatusUnderReview(dossier.getId(), file.getId(), user2);
|
||||
});
|
||||
|
||||
expectedMessage = "User must be dossier member";
|
||||
@ -583,7 +583,7 @@ public class FileTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
assertThat(actualMessage).contains(expectedMessage);
|
||||
|
||||
fileClient.setStatusUnderReview(dossier.getId(), file.getId(), altUserId, auditor);
|
||||
fileClient.setStatusUnderReview(dossier.getId(), file.getId(), altUserId);
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getWorkflowStatus()).isEqualTo(WorkflowStatus.UNDER_REVIEW);
|
||||
assertThat(loadedFile.getAssignee()).isEqualTo(altUserId);
|
||||
|
||||
@ -43,31 +43,31 @@ public class LegalBasisTest extends AbstractPersistenceServerServiceTest {
|
||||
var mappings = new ArrayList<LegalBasis>();
|
||||
mappings.add(LegalBasis.builder().name("test 1").description("test 1").reason("test 1").build());
|
||||
mappings.add(LegalBasis.builder().name("test 2").description("test 2").reason("test 2").build());
|
||||
legalBasisClient.setLegalBasisMapping(mappings, dossierTemplate.getId(), auditor);
|
||||
legalBasisClient.setLegalBasisMapping(mappings, dossierTemplate.getId());
|
||||
|
||||
var mapping = legalBasisClient.getLegalBasisMapping(dossierTemplate.getId());
|
||||
assertThat(mapping.size()).isEqualTo(2);
|
||||
assertThat(mapping.stream().map(LegalBasis::getName).collect(Collectors.toList())).containsExactlyInAnyOrder("test 1", "test 2");
|
||||
|
||||
var legalBasis = LegalBasis.builder().name("test 3").description("test 3").reason("test 3").build();
|
||||
legalBasisClient.addOrUpdateLegalBasis(dossierTemplate.getId(), legalBasis, auditor);
|
||||
legalBasisClient.addOrUpdateLegalBasis(dossierTemplate.getId(), legalBasis);
|
||||
|
||||
mapping = legalBasisClient.getLegalBasisMapping(dossierTemplate.getId());
|
||||
assertThat(mapping.size()).isEqualTo(3);
|
||||
assertThat(mapping.stream().map(LegalBasis::getName).collect(Collectors.toList())).containsExactlyInAnyOrder("test 1", "test 2", "test 3");
|
||||
|
||||
legalBasis = LegalBasis.builder().name("test 3").reason("test 3").description("test 3 - updated").build();
|
||||
legalBasisClient.addOrUpdateLegalBasis(dossierTemplate.getId(), legalBasis, auditor);
|
||||
legalBasisClient.addOrUpdateLegalBasis(dossierTemplate.getId(), legalBasis);
|
||||
|
||||
mapping = legalBasisClient.getLegalBasisMapping(dossierTemplate.getId());
|
||||
assertThat(mapping.size()).isEqualTo(3);
|
||||
assertThat(mapping.stream().map(LegalBasis::getDescription).collect(Collectors.toList())).containsExactlyInAnyOrder("test 1", "test 2", "test 3 - updated");
|
||||
|
||||
legalBasisClient.deleteLegalBasis(dossierTemplate.getId(), Lists.newArrayList("test 1"), auditor);
|
||||
legalBasisClient.deleteLegalBasis(dossierTemplate.getId(), Lists.newArrayList("test 1"));
|
||||
mapping = legalBasisClient.getLegalBasisMapping(dossierTemplate.getId());
|
||||
assertThat(mapping.size()).isEqualTo(2);
|
||||
|
||||
legalBasisClient.setLegalBasisMapping(Lists.newArrayList(), dossierTemplate.getId(), auditor);
|
||||
legalBasisClient.setLegalBasisMapping(Lists.newArrayList(), dossierTemplate.getId());
|
||||
assertThat(legalBasisClient.getLegalBasisMapping(dossierTemplate.getId())).isEmpty();
|
||||
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ public class LicenseReportTest extends AbstractPersistenceServerServiceTest {
|
||||
LicenseReport licenseReport = licenseReportClient.getReport(LicenseReportRequest.builder()
|
||||
.startDate(Instant.parse("2023-01-01T10:00:00Z"))
|
||||
.endDate(Instant.parse("2023-05-01T11:00:00Z"))
|
||||
.build(), auditor);
|
||||
.build());
|
||||
|
||||
assertThat(licenseReport.getTotalFilesUploadedBytes()).isEqualTo(900L);
|
||||
assertThat(licenseReport.getActiveFilesUploadedBytes()).isEqualTo(700L);
|
||||
|
||||
@ -95,7 +95,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
var type = typeProvider.testAndProvideType(dossierTemplate, null, "type", true);
|
||||
assertThat(type.isDossierDictionaryOnly()).isTrue();
|
||||
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("Luke Skywalker"), false, dossier.getDossierId(), DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("Luke Skywalker"), false, dossier.getDossierId(), DictionaryEntryType.ENTRY);
|
||||
|
||||
var redactionLog = new RedactionLog(1,
|
||||
1,
|
||||
@ -112,7 +112,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
Assertions.assertThrows(FeignException.Forbidden.class,
|
||||
() -> manualRedactionClient.removeRedactionBulk(dossier.getId(),
|
||||
file.getId(),
|
||||
Set.of(RemoveRedactionRequestModel.builder().annotationId("AnnotationId").removeFromDictionary(true).removeFromAllDossiers(true).build()), auditor));//.get(0);
|
||||
Set.of(RemoveRedactionRequestModel.builder().annotationId("AnnotationId").removeFromDictionary(true).removeFromAllDossiers(true).build())));//.get(0);
|
||||
|
||||
var dossierTemplateDictionary = internalDictionaryClient.getDictionaryForType(toTypeId(type.getType(), dossierTemplate.getDossierTemplateId()), null);
|
||||
assertThat(dossierTemplateDictionary.getEntries().size()).isZero();
|
||||
@ -143,7 +143,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
.value("Luke Skywalker")
|
||||
.legalBasis("1")
|
||||
.sourceId("SourceId")
|
||||
.build()), auditor));
|
||||
.build())));
|
||||
|
||||
var dossierTemplateDictionary = internalDictionaryClient.getDictionaryForType(toTypeId(type.getType(), dossierTemplate.getDossierTemplateId()), null);
|
||||
assertThat(dossierTemplateDictionary.getEntries().size()).isZero();
|
||||
@ -160,7 +160,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
var type = typeProvider.testAndProvideType(dossierTemplate);
|
||||
|
||||
dictionaryClient.deleteEntries(type.getType(), type.getDossierTemplateId(), List.of("Luke Skywalker"), dossier.getDossierId(), DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.deleteEntries(type.getType(), type.getDossierTemplateId(), List.of("Luke Skywalker"), dossier.getDossierId(), DictionaryEntryType.ENTRY);
|
||||
|
||||
var dossierDictionary = internalDictionaryClient.getDictionaryForType(toTypeId(type.getType(), dossierTemplate.getDossierTemplateId(), dossier.getDossierId()), null);
|
||||
assertThat(dossierDictionary.getEntries().size()).isEqualTo(1);
|
||||
@ -179,7 +179,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
.value("Luke Skywalker")
|
||||
.legalBasis("1")
|
||||
.sourceId("SourceId")
|
||||
.build()), auditor);
|
||||
.build()));
|
||||
|
||||
dossierDictionary = internalDictionaryClient.getDictionaryForType(toTypeId(type.getType(), dossierTemplate.getDossierTemplateId(), dossier.getDossierId()), null);
|
||||
assertThat(dossierDictionary.getEntries().size()).isEqualTo(1);
|
||||
@ -213,7 +213,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
.value("Luke Skywalker")
|
||||
.legalBasis("1")
|
||||
.sourceId("SourceId")
|
||||
.build()), auditor);
|
||||
.build()));
|
||||
|
||||
var dossierDictionary = internalDictionaryClient.getDictionaryForType(toTypeId(type.getType(), dossierTemplate.getDossierTemplateId(), dossier.getDossierId()), null);
|
||||
assertThat(dossierDictionary.getEntries().size()).isEqualTo(1);
|
||||
@ -236,9 +236,9 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
var entries = new ArrayList<String>();
|
||||
entries.add("Luke Skywalker");
|
||||
entries.add("Darth Vader");
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY);
|
||||
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("Luke Skywalker"), false, dossier.getDossierId(), DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("Luke Skywalker"), false, dossier.getDossierId(), DictionaryEntryType.ENTRY);
|
||||
|
||||
Dictionary dossierTemplateDictionary = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
assertThat(dossierTemplateDictionary.getEntries()).containsExactlyInAnyOrder("Luke Skywalker", "Darth Vader");
|
||||
@ -260,7 +260,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
manualRedactionClient.removeRedactionBulk(dossier.getId(),
|
||||
file.getId(),
|
||||
Set.of(RemoveRedactionRequestModel.builder().annotationId("AnnotationId").removeFromDictionary(true).removeFromAllDossiers(true).build()), auditor);
|
||||
Set.of(RemoveRedactionRequestModel.builder().annotationId("AnnotationId").removeFromDictionary(true).removeFromAllDossiers(true).build()));
|
||||
|
||||
dossierTemplateDictionary = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
assertThat(dossierTemplateDictionary.getEntries()).containsExactlyInAnyOrder("Darth Vader");
|
||||
@ -288,7 +288,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
var entries = new ArrayList<String>();
|
||||
entries.add("Luke Skywalker");
|
||||
entries.add("Darth Vader");
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY);
|
||||
|
||||
//FIXME should be created on the fly.
|
||||
// CreateTypeValue dossierDictionaryType = MagicConverter.convert(type, CreateTypeValue.class);
|
||||
@ -308,7 +308,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
manualRedactionClient.removeRedactionBulk(dossier.getId(),
|
||||
file.getId(),
|
||||
Set.of(RemoveRedactionRequestModel.builder().annotationId("AnnotationId").removeFromDictionary(true).build()), auditor).get(0);
|
||||
Set.of(RemoveRedactionRequestModel.builder().annotationId("AnnotationId").removeFromDictionary(true).build())).get(0);
|
||||
|
||||
var dossierDictionary = internalDictionaryClient.getDictionaryForType(toTypeId(type.getType(), dossierTemplate.getDossierTemplateId(), dossier.getDossierId()), null);
|
||||
|
||||
@ -333,7 +333,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
//FIXME should be created on the fly.
|
||||
// CreateTypeValue dossierDictionaryType = MagicConverter.convert(type, CreateTypeValue.class);
|
||||
// dictionaryClient.addType(dossierDictionaryType, dossier.getDossierId());
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("Luke Skywalker"), false, dossier.getDossierId(), DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of("Luke Skywalker"), false, dossier.getDossierId(), DictionaryEntryType.ENTRY);
|
||||
|
||||
var redactionLog = new RedactionLog(1,
|
||||
1,
|
||||
@ -349,7 +349,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
manualRedactionClient.removeRedactionBulk(dossier.getId(),
|
||||
file.getId(),
|
||||
Set.of(RemoveRedactionRequestModel.builder().annotationId("AnnotationId").removeFromDictionary(true).removeFromAllDossiers(true).build()), auditor).get(0);
|
||||
Set.of(RemoveRedactionRequestModel.builder().annotationId("AnnotationId").removeFromDictionary(true).removeFromAllDossiers(true).build())).get(0);
|
||||
|
||||
var dossierDictionary = internalDictionaryClient.getDictionaryForType(toTypeId(type.getType(), dossierTemplate.getDossierTemplateId(), dossier.getDossierId()), null);
|
||||
assertThat(dossierDictionary.getEntries().size()).isEqualTo(1);
|
||||
@ -405,7 +405,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
.sourceId("SourceId")
|
||||
.build();
|
||||
|
||||
var addRedactions = manualRedactionClient.addRedactionBulk(dossier1.getDossierId(), file1.getId(), Set.of(redactionDos, redactionDosTempDict), auditor);
|
||||
var addRedactions = manualRedactionClient.addRedactionBulk(dossier1.getDossierId(), file1.getId(), Set.of(redactionDos, redactionDosTempDict));
|
||||
var loadedRedactionsFile1 = manualRedactionClient.getManualRedactions(file1.getDossierId(), file1.getFileId());
|
||||
|
||||
var redactionLog1 = new RedactionLog(1,
|
||||
@ -457,7 +457,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
.addToAllDossiers(true)
|
||||
.build();
|
||||
|
||||
manualRedactionClient.resizeRedactionBulk(dossier1.getDossierId(), file1.getFileId(), Set.of(resizeRedactionDosAndAddToAllDos), auditor);
|
||||
manualRedactionClient.resizeRedactionBulk(dossier1.getDossierId(), file1.getFileId(), Set.of(resizeRedactionDosAndAddToAllDos));
|
||||
|
||||
loadedRedactionsFile1 = manualRedactionClient.getManualRedactions(file1.getDossierId(), file1.getFileId());
|
||||
|
||||
@ -552,7 +552,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
.sourceId("SourceId")
|
||||
.build();
|
||||
|
||||
var addRedactions = manualRedactionClient.addRedactionBulk(dossier1.getDossierId(), file1.getId(), Set.of(redactionDos, redactionDosTempDict), auditor);
|
||||
var addRedactions = manualRedactionClient.addRedactionBulk(dossier1.getDossierId(), file1.getId(), Set.of(redactionDos, redactionDosTempDict));
|
||||
var loadedRedactionsFile1 = manualRedactionClient.getManualRedactions(file1.getDossierId(), file1.getFileId());
|
||||
|
||||
var redactionLog1 = new RedactionLog(1,
|
||||
@ -604,7 +604,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
.addToAllDossiers(true)
|
||||
.build();
|
||||
|
||||
manualRedactionClient.resizeRedactionBulk(dossier1.getDossierId(), file1.getFileId(), Set.of(resizeRedactionDosAndAddToAllDos), auditor);
|
||||
manualRedactionClient.resizeRedactionBulk(dossier1.getDossierId(), file1.getFileId(), Set.of(resizeRedactionDosAndAddToAllDos));
|
||||
|
||||
loadedRedactionsFile1 = manualRedactionClient.getManualRedactions(file1.getDossierId(), file1.getFileId());
|
||||
|
||||
@ -702,7 +702,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
.sourceId("SourceId")
|
||||
.build();
|
||||
|
||||
var addRedactions = manualRedactionClient.addRedactionBulk(dossier1.getDossierId(), file1.getId(), Set.of(redactionDos, redactionDosTempDict), auditor);
|
||||
var addRedactions = manualRedactionClient.addRedactionBulk(dossier1.getDossierId(), file1.getId(), Set.of(redactionDos, redactionDosTempDict));
|
||||
|
||||
var redactionLog1 = new RedactionLog(1,
|
||||
1,
|
||||
@ -753,7 +753,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
.addToAllDossiers(true)
|
||||
.build();
|
||||
|
||||
var resizeRedactions = manualRedactionClient.resizeRedactionBulk(dossier2.getDossierId(), file2.getFileId(), Set.of(resizeRedactionDosTemp), auditor);
|
||||
var resizeRedactions = manualRedactionClient.resizeRedactionBulk(dossier2.getDossierId(), file2.getFileId(), Set.of(resizeRedactionDosTemp));
|
||||
|
||||
var loadedRedactionsFile2 = manualRedactionClient.getManualRedactions(file2.getDossierId(), file2.getFileId());
|
||||
|
||||
@ -848,7 +848,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
.sourceId("SourceId")
|
||||
.build();
|
||||
|
||||
var addRedactions = manualRedactionClient.addRedactionBulk(dossier1.getDossierId(), file1.getId(), Set.of(redactionDos, redactionDosTempDict), auditor);
|
||||
var addRedactions = manualRedactionClient.addRedactionBulk(dossier1.getDossierId(), file1.getId(), Set.of(redactionDos, redactionDosTempDict));
|
||||
|
||||
var redactionLog1 = new RedactionLog(1,
|
||||
1,
|
||||
@ -899,7 +899,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
.addToAllDossiers(true)
|
||||
.build();
|
||||
|
||||
var resizeRedactions = manualRedactionClient.resizeRedactionBulk(dossier2.getDossierId(), file2.getFileId(), Set.of(resizeRedactionDosTemp), auditor);
|
||||
var resizeRedactions = manualRedactionClient.resizeRedactionBulk(dossier2.getDossierId(), file2.getFileId(), Set.of(resizeRedactionDosTemp));
|
||||
|
||||
var loadedRedactionsFile2 = manualRedactionClient.getManualRedactions(file2.getDossierId(), file2.getFileId());
|
||||
|
||||
@ -966,9 +966,9 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
var darthVader = "Darth Vader";
|
||||
entries.add(lukeSkywalker);
|
||||
entries.add(darthVader);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), entries, false, null, DictionaryEntryType.ENTRY);
|
||||
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of(lukeSkywalker), false, dossier.getDossierId(), DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), List.of(lukeSkywalker), false, dossier.getDossierId(), DictionaryEntryType.ENTRY);
|
||||
|
||||
Dictionary dossierTemplateDictionary = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
assertThat(dossierTemplateDictionary.getEntries()).containsExactlyInAnyOrder(lukeSkywalker, darthVader);
|
||||
@ -995,7 +995,7 @@ public class ManualRedactionTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
manualRedactionClient.recategorizeBulk(dossier.getId(),
|
||||
file.getId(),
|
||||
Set.of(RecategorizationRequestModel.builder().type(type2.getType()).annotationId(annotationId).addToDictionary(true).addToAllDossiers(true).build()), auditor);
|
||||
Set.of(RecategorizationRequestModel.builder().type(type2.getType()).annotationId(annotationId).addToDictionary(true).addToAllDossiers(true).build()));
|
||||
|
||||
dossierTemplateDictionary = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
assertThat(dossierTemplateDictionary.getEntries()).containsExactlyInAnyOrder(darthVader);
|
||||
|
||||
@ -46,32 +46,32 @@ public class ReanalysisTest extends AbstractPersistenceServerServiceTest {
|
||||
var loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getProcessingStatus()).isNotEqualTo(ProcessingStatus.PROCESSED);
|
||||
|
||||
reanalysisClient.ocrDossier(dossier.getId(), auditor);
|
||||
reanalysisClient.ocrDossier(dossier.getId());
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getProcessingStatus()).isNotEqualTo(ProcessingStatus.PROCESSED);
|
||||
resetProcessingStatus(file);
|
||||
|
||||
reanalysisClient.ocrDossier(dossier.getId(), auditor);
|
||||
reanalysisClient.ocrDossier(dossier.getId());
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getProcessingStatus()).isEqualTo(ProcessingStatus.OCR_PROCESSING_QUEUED);
|
||||
resetProcessingStatus(file);
|
||||
|
||||
reanalysisClient.ocrFile(dossier.getId(), file.getId(), true, auditor);
|
||||
reanalysisClient.ocrFile(dossier.getId(), file.getId(), true);
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getProcessingStatus()).isEqualTo(ProcessingStatus.OCR_PROCESSING_QUEUED);
|
||||
resetProcessingStatus(file);
|
||||
|
||||
reanalysisClient.ocrFiles(dossier.getId(), Set.of(file.getId()), auditor);
|
||||
reanalysisClient.ocrFiles(dossier.getId(), Set.of(file.getId()));
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getProcessingStatus()).isEqualTo(ProcessingStatus.OCR_PROCESSING_QUEUED);
|
||||
resetProcessingStatus(file);
|
||||
|
||||
reanalysisClient.reanalyzeFilesForDossier(dossier.getId(), List.of(file.getId()), true, auditor);
|
||||
reanalysisClient.reanalyzeFilesForDossier(dossier.getId(), List.of(file.getId()), true);
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getProcessingStatus()).isEqualTo(ProcessingStatus.FULL_PROCESSING);
|
||||
resetProcessingStatus(file);
|
||||
|
||||
reanalysisClient.reanalyzeDossier(dossier.getId(), true, auditor);
|
||||
reanalysisClient.reanalyzeDossier(dossier.getId(), true);
|
||||
loadedFile = fileClient.getFileStatus(dossier.getId(), file.getId());
|
||||
assertThat(loadedFile.getProcessingStatus()).isEqualTo(ProcessingStatus.FULL_PROCESSING);
|
||||
resetProcessingStatus(file);
|
||||
|
||||
@ -51,7 +51,7 @@ public class ReportTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
// var download = reportTemplateClient.downloadReportTemplate(firstTemplate.getDossierTemplateId(), firstTemplate.getTemplateId());
|
||||
// assertThat(download.getFile().length).isEqualTo(4);
|
||||
|
||||
reportTemplateClient.deleteTemplate(firstTemplate.getDossierTemplateId(), firstTemplate.getTemplateId(), auditor);
|
||||
reportTemplateClient.deleteTemplate(firstTemplate.getDossierTemplateId(), firstTemplate.getTemplateId());
|
||||
|
||||
availableTemplates = reportTemplateClient.getAvailableReportTemplates(dossierTemplate.getId());
|
||||
assertThat(availableTemplates).isEmpty();
|
||||
@ -82,7 +82,7 @@ public class ReportTemplateTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(availableTemplates.iterator().next()).isEqualTo(firstTemplate);
|
||||
assertThat(firstTemplate.getFileName()).isEqualTo("report.xlsx");
|
||||
|
||||
reportTemplateClient.deleteTemplate(firstTemplate.getDossierTemplateId(), firstTemplate.getTemplateId(), auditor);
|
||||
reportTemplateClient.deleteTemplate(firstTemplate.getDossierTemplateId(), firstTemplate.getTemplateId());
|
||||
|
||||
availableTemplates = reportTemplateClient.getAvailableReportTemplates(dossierTemplate.getId());
|
||||
assertThat(availableTemplates).isEmpty();
|
||||
|
||||
@ -29,13 +29,13 @@ public class RulesTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
var dossierTemplate = dossierTemplateTesterAndProvider.provideTestTemplate();
|
||||
|
||||
rulesClient.upload(new RulesUploadRequest("lorem ipsum", dossierTemplate.getId()), auditor);
|
||||
rulesClient.upload(new RulesUploadRequest("lorem ipsum", dossierTemplate.getId()));
|
||||
assertThat(versionClient.getVersions(List.of(dossierTemplate.getId()))
|
||||
.get(dossierTemplate.getId())
|
||||
.getRulesVersion()).isEqualTo(3); //1. beim Anlegen des DossierTemplates; 2. bei provideTestTemplate(), damit es ACTIVE ist
|
||||
assertThat(rulesClient.download(dossierTemplate.getId()).getRules()).isEqualTo("lorem ipsum");
|
||||
|
||||
rulesClient.upload(new RulesUploadRequest("lorem ipsum dolor sit amet", dossierTemplate.getId()), auditor);
|
||||
rulesClient.upload(new RulesUploadRequest("lorem ipsum dolor sit amet", dossierTemplate.getId()));
|
||||
assertThat(versionClient.getVersions(List.of(dossierTemplate.getId())).get(dossierTemplate.getId()).getRulesVersion()).isEqualTo(4);
|
||||
assertThat(rulesClient.download(dossierTemplate.getId()).getRules()).isEqualTo("lorem ipsum dolor sit amet");
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ public class TypeTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
var type = typeProvider.testAndProvideType(dossierTemplate);
|
||||
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), Lists.newArrayList("aaa", "bbb", "ccc"), true, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), Lists.newArrayList("aaa", "bbb", "ccc"), true, null, DictionaryEntryType.ENTRY);
|
||||
|
||||
var loadedType = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
|
||||
@ -49,7 +49,7 @@ public class TypeTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
assertThat(dict.size()).isEqualTo(3);
|
||||
|
||||
dictionaryClient.deleteEntries(type.getType(), type.getDossierTemplateId(), Lists.newArrayList("aaa", "bbb", "ccc"), null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.deleteEntries(type.getType(), type.getDossierTemplateId(), Lists.newArrayList("aaa", "bbb", "ccc"), null, DictionaryEntryType.ENTRY);
|
||||
|
||||
loadedType = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
|
||||
@ -60,12 +60,12 @@ public class TypeTest extends AbstractPersistenceServerServiceTest {
|
||||
var request = new UpdateTypeValue();
|
||||
BeanUtils.copyProperties(type, request);
|
||||
request.setRank(99);
|
||||
dictionaryClient.updateType(type.getType(), type.getDossierTemplateId(), request, auditor);
|
||||
dictionaryClient.updateType(type.getType(), type.getDossierTemplateId(), request);
|
||||
|
||||
loadedType = dictionaryClient.getDictionaryForType(type.getType(), type.getDossierTemplateId(), null);
|
||||
assertThat(loadedType.getRank()).isEqualTo(99);
|
||||
|
||||
dictionaryClient.deleteType(type.getType(), type.getDossierTemplateId(), auditor);
|
||||
dictionaryClient.deleteType(type.getType(), type.getDossierTemplateId());
|
||||
|
||||
var typesForTemplate = dictionaryClient.getAllTypes(loadedType.getDossierTemplateId(), null, false).getTypes();
|
||||
assertThat(typesForTemplate).isEmpty();
|
||||
@ -101,7 +101,7 @@ public class TypeTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
colors.setDossierTemplateId(dossierTemplate.getId());
|
||||
|
||||
dictionaryClient.setColors(dossierTemplate.getId(), colors, auditor);
|
||||
dictionaryClient.setColors(dossierTemplate.getId(), colors);
|
||||
|
||||
var savedColors = dictionaryClient.getColors(dossierTemplate.getId());
|
||||
assertThat(savedColors).isEqualTo(colors);
|
||||
|
||||
@ -13,7 +13,6 @@ import com.iqser.red.service.peristence.v1.server.integration.service.UserProvid
|
||||
import com.iqser.red.service.peristence.v1.server.integration.utils.AbstractPersistenceServerServiceTest;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.ViewedPagesRequest;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.annotations.ViewedPage;
|
||||
import com.iqser.red.service.persistence.service.v1.api.shared.model.common.JSONPrimitive;
|
||||
|
||||
public class ViewedPagesTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
@ -41,7 +40,7 @@ public class ViewedPagesTest extends AbstractPersistenceServerServiceTest {
|
||||
var file = fileTesterAndProvider.testAndProvideFile(dossier);
|
||||
var userId = userProvider.getUserId();
|
||||
|
||||
fileClient.setCurrentFileAssignee(dossier.getId(), file.getId(), userId, auditor);
|
||||
fileClient.setCurrentFileAssignee(dossier.getId(), file.getId(), userId);
|
||||
var fileId = file.getId();
|
||||
|
||||
viewedPagesClient.addPage(dossier.getId(),fileId, new ViewedPagesRequest(1));
|
||||
|
||||
@ -55,20 +55,20 @@ public class WatermarkTest extends AbstractPersistenceServerServiceTest {
|
||||
watermark.setDossierTemplateId(dossierTemplate.getId());
|
||||
watermark.setCreatedBy("user");
|
||||
|
||||
var saved = watermarkClient.saveWatermark(watermark, auditor);
|
||||
var saved = watermarkClient.saveWatermark(watermark);
|
||||
var loadedWatermark = watermarkClient.getWatermark(saved.getId());
|
||||
assertThat(loadedWatermark).isEqualTo(saved);
|
||||
assertThat(saved.getDateAdded()).isNotNull();
|
||||
// try to save the same watermark without id
|
||||
try {
|
||||
watermarkClient.saveWatermark(watermark, auditor);
|
||||
watermarkClient.saveWatermark(watermark);
|
||||
} catch (FeignException e) {
|
||||
assertThat(e.status()).isEqualTo(409);
|
||||
}
|
||||
|
||||
// try to save the same watermark with id
|
||||
try {
|
||||
watermarkClient.saveWatermark(saved, auditor);
|
||||
watermarkClient.saveWatermark(saved);
|
||||
} catch (FeignException e) {
|
||||
assertThat(e.status()).isEqualTo(409);
|
||||
}
|
||||
@ -77,7 +77,7 @@ public class WatermarkTest extends AbstractPersistenceServerServiceTest {
|
||||
saved.setFontSize(14);
|
||||
saved.setEnabled(true);
|
||||
saved.setDossierTemplateId(null);
|
||||
var updated = watermarkClient.saveWatermark(saved, auditor);
|
||||
var updated = watermarkClient.saveWatermark(saved);
|
||||
assertThat(updated.getDossierTemplateId()).isEqualTo(dossierTemplate.getId());
|
||||
assertThat(updated.getDateModified()).isNotNull();
|
||||
assertThat(updated.isEnabled()).isTrue();
|
||||
@ -93,7 +93,7 @@ public class WatermarkTest extends AbstractPersistenceServerServiceTest {
|
||||
cru.setDossierId(dossier.getId());
|
||||
cru.setWatermarkId(updated.getId());
|
||||
|
||||
var updatedDossier = dossierClient.createDossierOrUpdateDossier(cru, auditor).getBody();
|
||||
var updatedDossier = dossierClient.createDossierOrUpdateDossier(cru).getBody();
|
||||
assertThat(updatedDossier.getWatermarkId()).isEqualTo(updated.getId());
|
||||
|
||||
assertThat(watermarkClient.isWatermarkUsed(updated.getId())).isEqualTo(JSONPrimitive.of(true));
|
||||
@ -101,7 +101,7 @@ public class WatermarkTest extends AbstractPersistenceServerServiceTest {
|
||||
// update current watermark with new dossier template id
|
||||
updated.setDossierTemplateId("dossierTemplate2");
|
||||
try {
|
||||
watermarkClient.saveWatermark(updated, auditor);
|
||||
watermarkClient.saveWatermark(updated);
|
||||
} catch (FeignException e) {
|
||||
assertThat(e.status()).isEqualTo(409);
|
||||
}
|
||||
@ -116,7 +116,7 @@ public class WatermarkTest extends AbstractPersistenceServerServiceTest {
|
||||
watermark2.setDossierTemplateId(dossierTemplate.getId());
|
||||
|
||||
try {
|
||||
watermarkClient.saveWatermark(watermark2, auditor);
|
||||
watermarkClient.saveWatermark(watermark2);
|
||||
} catch (FeignException.FeignClientException e) {
|
||||
assertThat(e.status()).isEqualTo(409);
|
||||
}
|
||||
@ -139,12 +139,12 @@ public class WatermarkTest extends AbstractPersistenceServerServiceTest {
|
||||
watermark.setOrientation(WatermarkOrientation.DIAGONAL);
|
||||
watermark.setDossierTemplateId(dossierTemplate.getId());
|
||||
|
||||
var saved = watermarkClient.saveWatermark(watermark, auditor);
|
||||
var saved = watermarkClient.saveWatermark(watermark);
|
||||
var loadedWatermark = watermarkClient.getWatermark(saved.getId());
|
||||
assertThat(loadedWatermark).isEqualTo(saved);
|
||||
|
||||
// Delete first time
|
||||
watermarkClient.deleteWatermark(saved.getId(), auditor);
|
||||
watermarkClient.deleteWatermark(saved.getId());
|
||||
|
||||
try {
|
||||
watermarkClient.getWatermark(saved.getId());
|
||||
@ -154,7 +154,7 @@ public class WatermarkTest extends AbstractPersistenceServerServiceTest {
|
||||
|
||||
// try to delete a not existing watermark
|
||||
try {
|
||||
watermarkClient.deleteWatermark(saved.getId(), auditor);
|
||||
watermarkClient.deleteWatermark(saved.getId());
|
||||
} catch (FeignException e) {
|
||||
assertThat(e.status()).isEqualTo(404);
|
||||
}
|
||||
@ -177,13 +177,13 @@ public class WatermarkTest extends AbstractPersistenceServerServiceTest {
|
||||
watermark.setOrientation(WatermarkOrientation.DIAGONAL);
|
||||
watermark.setDossierTemplateId(dossierTemplate.getId());
|
||||
|
||||
var saved = watermarkClient.saveWatermark(watermark, auditor);
|
||||
var saved = watermarkClient.saveWatermark(watermark);
|
||||
var loadedWatermark = watermarkClient.getWatermark(saved.getId());
|
||||
assertThat(loadedWatermark).isEqualTo(saved);
|
||||
|
||||
// try to save the same watermark
|
||||
try {
|
||||
watermarkClient.saveWatermark(watermark, auditor);
|
||||
watermarkClient.saveWatermark(watermark);
|
||||
} catch (FeignException e) {
|
||||
assertThat(e.status()).isEqualTo(409);
|
||||
}
|
||||
@ -195,7 +195,7 @@ public class WatermarkTest extends AbstractPersistenceServerServiceTest {
|
||||
watermark.setOrientation(WatermarkOrientation.DIAGONAL);
|
||||
watermark.setDossierTemplateId(dossierTemplate.getId());
|
||||
|
||||
var saved2 = watermarkClient.saveWatermark(watermark, auditor);
|
||||
var saved2 = watermarkClient.saveWatermark(watermark);
|
||||
var loadedWatermark2 = watermarkClient.getWatermark(saved.getId());
|
||||
}
|
||||
|
||||
@ -215,7 +215,7 @@ public class WatermarkTest extends AbstractPersistenceServerServiceTest {
|
||||
watermark.setDossierTemplateId(dossierTemplate.getId());
|
||||
|
||||
Exception exception = Assertions.assertThrows(FeignException.BadRequest.class, () -> {
|
||||
watermarkClient.saveWatermark(watermark, auditor);
|
||||
watermarkClient.saveWatermark(watermark);
|
||||
});
|
||||
|
||||
String expectedMessage = "The specified color: " + color + " is malformed.";
|
||||
@ -224,7 +224,7 @@ public class WatermarkTest extends AbstractPersistenceServerServiceTest {
|
||||
assertThat(actualMessage).contains(expectedMessage);
|
||||
|
||||
watermark.setHexColor(null);
|
||||
var saved2 = watermarkClient.saveWatermark(watermark, auditor);
|
||||
var saved2 = watermarkClient.saveWatermark(watermark);
|
||||
|
||||
assertThat(saved2.getHexColor()).isEqualTo("#000000");
|
||||
}
|
||||
@ -246,7 +246,7 @@ public class WatermarkTest extends AbstractPersistenceServerServiceTest {
|
||||
watermark.setDossierTemplateId(dossierTemplate.getId());
|
||||
assertThat(watermark.getOpacity()).isEqualTo(0);
|
||||
|
||||
var saved2 = watermarkClient.saveWatermark(watermark, auditor);
|
||||
var saved2 = watermarkClient.saveWatermark(watermark);
|
||||
|
||||
assertThat(saved2.getOpacity()).isEqualTo(0);
|
||||
|
||||
@ -261,7 +261,7 @@ public class WatermarkTest extends AbstractPersistenceServerServiceTest {
|
||||
watermark2.setDossierTemplateId(dossierTemplate.getId());
|
||||
watermark2.setOpacity(-1);
|
||||
|
||||
saved2 = watermarkClient.saveWatermark(watermark2, auditor);
|
||||
saved2 = watermarkClient.saveWatermark(watermark2);
|
||||
|
||||
assertThat(saved2.getOpacity()).isEqualTo(30);
|
||||
}
|
||||
@ -283,7 +283,7 @@ public class WatermarkTest extends AbstractPersistenceServerServiceTest {
|
||||
watermark.setOrientation(WatermarkOrientation.DIAGONAL);
|
||||
watermark.setText(watermarkText);
|
||||
|
||||
var saved = watermarkClient.saveWatermark(watermark, auditor);
|
||||
var saved = watermarkClient.saveWatermark(watermark);
|
||||
var loadedWatermarked = watermarkClient.getWatermark(saved.getId());
|
||||
|
||||
assertThat(loadedWatermarked).isEqualTo(saved);
|
||||
@ -310,7 +310,7 @@ public class WatermarkTest extends AbstractPersistenceServerServiceTest {
|
||||
watermark.setText(watermarkText);
|
||||
|
||||
// Act
|
||||
var saved = watermarkClient.saveWatermark(watermark, auditor);
|
||||
var saved = watermarkClient.saveWatermark(watermark);
|
||||
var loadedWatermarked = watermarkClient.getWatermark(saved.getId());
|
||||
|
||||
// Assert
|
||||
|
||||
@ -55,25 +55,25 @@ public class EntityPerformanceTest extends AbstractPersistenceServerServiceTest
|
||||
var tenKEntries = generateEntries(10000);
|
||||
|
||||
long t1 = System.currentTimeMillis();
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), fiveKEntries, true, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), fiveKEntries, true, null, DictionaryEntryType.ENTRY);
|
||||
long t2 = System.currentTimeMillis();
|
||||
log.info("Add Time: {}ms counting: {} entries", (t2 - t1), entryRepository.findByTypeIdAndVersionGreaterThan(type.getTypeId(), 0).size());
|
||||
|
||||
t1 = System.currentTimeMillis();
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), tenKEntries, true, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), tenKEntries, true, null, DictionaryEntryType.ENTRY);
|
||||
t2 = System.currentTimeMillis();
|
||||
log.info("Add Time: {}ms counting: {} entries", (t2 - t1), entryRepository.findByTypeIdAndVersionGreaterThan(type.getTypeId(), 0).size());
|
||||
|
||||
t1 = System.currentTimeMillis();
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), fiveKEntries, true, null, DictionaryEntryType.ENTRY, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), fiveKEntries, true, null, DictionaryEntryType.ENTRY);
|
||||
t2 = System.currentTimeMillis();
|
||||
log.info("Update Time: {}ms counting: {} entries", (t2 - t1), entryRepository.findByTypeIdAndVersionGreaterThan(type.getTypeId(), 0).size());
|
||||
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), fiveKEntries, true, null, DictionaryEntryType.FALSE_RECOMMENDATION, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), fiveKEntries, true, null, DictionaryEntryType.FALSE_POSITIVE, auditor);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), fiveKEntries, true, null, DictionaryEntryType.FALSE_RECOMMENDATION);
|
||||
dictionaryClient.addEntry(type.getType(), type.getDossierTemplateId(), fiveKEntries, true, null, DictionaryEntryType.FALSE_POSITIVE);
|
||||
|
||||
t1 = System.currentTimeMillis();
|
||||
var cloned = dossierTemplateClient.cloneDossierTemplate(template.getId(), new CloneDossierTemplateRequest(), auditor);
|
||||
var cloned = dossierTemplateClient.cloneDossierTemplate(template.getId(), new CloneDossierTemplateRequest());
|
||||
t2 = System.currentTimeMillis();
|
||||
log.info("Clone Time: {}", (t2 - t1));
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user