From f3a7d40ff920280fa5695fc578e63eb302ea46d7 Mon Sep 17 00:00:00 2001 From: Ali Oezyetimoglu Date: Wed, 22 May 2024 20:03:00 +0200 Subject: [PATCH] RED-8339: Updated OpenApi Specs --- .../tests/ComponentLogDocumentMapperTest.java | 62 ---- .../componentlog/componentLogExample.json | 266 ------------------ .../componentOverrideExample.json | 244 ---------------- 3 files changed, 572 deletions(-) delete mode 100644 persistence-service-v1/persistence-service-server-v1/src/test/java/com/iqser/red/service/peristence/v1/server/integration/tests/ComponentLogDocumentMapperTest.java delete mode 100644 persistence-service-v1/persistence-service-server-v1/src/test/resources/files/componentlog/componentLogExample.json delete mode 100644 persistence-service-v1/persistence-service-server-v1/src/test/resources/files/componentlog/componentOverrideExample.json diff --git a/persistence-service-v1/persistence-service-server-v1/src/test/java/com/iqser/red/service/peristence/v1/server/integration/tests/ComponentLogDocumentMapperTest.java b/persistence-service-v1/persistence-service-server-v1/src/test/java/com/iqser/red/service/peristence/v1/server/integration/tests/ComponentLogDocumentMapperTest.java deleted file mode 100644 index d1b3b1471..000000000 --- a/persistence-service-v1/persistence-service-server-v1/src/test/java/com/iqser/red/service/peristence/v1/server/integration/tests/ComponentLogDocumentMapperTest.java +++ /dev/null @@ -1,62 +0,0 @@ -//package com.iqser.red.service.peristence.v1.server.integration.tests; -// -//import static com.mongodb.assertions.Assertions.assertNotNull; -//import static com.mongodb.assertions.Assertions.assertTrue; -//import static org.junit.jupiter.api.Assertions.assertEquals; -// -//import java.util.List; -//import java.util.Optional; -// -//import org.junit.jupiter.api.Test; -//import org.springframework.core.io.ClassPathResource; -// -//import com.fasterxml.jackson.databind.ObjectMapper; -//import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -//import com.iqser.red.service.persistence.service.v1.api.shared.mongo.document.ComponentDocument; -//import com.iqser.red.service.persistence.service.v1.api.shared.mongo.mapper.ComponentLogDocumentMapper; -// -//import lombok.SneakyThrows; -// -//public class ComponentLogDocumentMapperTest { -// -// private final ComponentLogDocumentMapper mapper = ComponentLogDocumentMapper.INSTANCE; -// -// private final String COMPONENT_LOG = "files/componentlog/componentLogExample.json"; -// private final String COMPONENT_OVERRIDE = "files/componentlog/componentOverrideExample.json"; -// private static final String TEST_DOSSIER_ID = "91ce8e90-9aec-473c-b8c3-cbe16443ad34"; -// private static final String TEST_FILE_ID = "b2cbdd4dca0aa1aa0ebbfc5cc1462df0"; -// -// -// @Test -// @SneakyThrows -// public void ComponentOverrideMapper() { -// -// var overrideFile = new ClassPathResource(String.format(COMPONENT_OVERRIDE)); -// ObjectMapper objectMapper = new ObjectMapper(); -// objectMapper.registerModule(new JavaTimeModule()); -// -// ComponentsOverrides componentsOverridesBefore = objectMapper.readValue(overrideFile.getInputStream(), ComponentsOverrides.class); -// -// List componentDocument = mapper.toComponentOverrideDocuments(componentsOverridesBefore, TEST_DOSSIER_ID, TEST_FILE_ID); -// -// assertEquals(componentDocument.get(0).getDossierId(), TEST_DOSSIER_ID); -// assertEquals(componentDocument.get(0).getFileId(), TEST_FILE_ID); -// assertEquals(componentDocument.get(0).getId(), mapper.getComponentId(TEST_DOSSIER_ID, TEST_FILE_ID, componentDocument.get(0).getName())); -// -// Optional optionalComponentValueDocument = componentDocument.get(0).getOverrideValues() -// .stream() -// .findFirst(); -// -// assertTrue(optionalComponentValueDocument.isPresent()); -// assertNotNull(optionalComponentValueDocument.get().getValueId()); -// assertNotNull(optionalComponentValueDocument.get().getComponentOverrideId()); -// -// ComponentsOverrides componentsOverridesAfter = mapper.fromComponentOverrideDocument(componentDocument.get(0)); -// -// assertEquals(mapper.buildComponentOverrideMap(componentDocument.get(0).getName(), -// componentsOverridesBefore.getComponentOverrides() -// .get(componentDocument.get(0).getName())), componentsOverridesAfter); -// -// } -// -//} diff --git a/persistence-service-v1/persistence-service-server-v1/src/test/resources/files/componentlog/componentLogExample.json b/persistence-service-v1/persistence-service-server-v1/src/test/resources/files/componentlog/componentLogExample.json deleted file mode 100644 index 9c51139c2..000000000 --- a/persistence-service-v1/persistence-service-server-v1/src/test/resources/files/componentlog/componentLogExample.json +++ /dev/null @@ -1,266 +0,0 @@ -{ - "analysisNumber": 3, - "componentRulesVersion": 1, - "componentLogEntries": [ - { - "name": "Study_Title", - "componentValues": [ - { - "valueId": null, - "value": "", - "originalValue": "", - "valueDescription": "First found value of type or else ''", - "componentRuleId": "StudyTitle.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Performing_Laboratory", - "componentValues": [ - { - "valueId": null, - "value": "", - "originalValue": "", - "valueDescription": "fallback", - "componentRuleId": "PerformingLaboratory.0.2", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Report_Number", - "componentValues": [ - { - "valueId": null, - "value": "", - "originalValue": "", - "valueDescription": "First found value of type or else ''", - "componentRuleId": "ReportNumber.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "GLP_Study", - "componentValues": [ - { - "valueId": null, - "value": "No", - "originalValue": "No", - "valueDescription": "Yes if present, No if not", - "componentRuleId": "GLPStudy.1.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Test_Guidelines_2", - "componentValues": [ - { - "valueId": null, - "value": "", - "originalValue": "", - "valueDescription": "Joining all values of type with ', '", - "componentRuleId": "TestGuideline.2.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Experimental_Starting_Date", - "componentValues": [ - { - "valueId": null, - "value": "", - "originalValue": "", - "valueDescription": "Convert values of type '' to dd/MM/yyyy joined with ', '", - "componentRuleId": "StartDate.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Experimental_Completion_Date", - "componentValues": [ - { - "valueId": null, - "value": "", - "originalValue": "", - "valueDescription": "Convert values of type '' to dd/MM/yyyy joined with ', '", - "componentRuleId": "CompletionDate.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Certificate_of_Analysis_Batch_Identification", - "componentValues": [ - { - "valueId": null, - "value": "", - "originalValue": "", - "valueDescription": "Joining all unique values of type with ', '", - "componentRuleId": "AnalysisCertificate.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Species", - "componentValues": [ - { - "valueId": null, - "value": "", - "originalValue": "", - "valueDescription": "First found value of type or else ''", - "componentRuleId": "Species.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Strain", - "componentValues": [ - { - "valueId": null, - "value": "", - "originalValue": "", - "valueDescription": "First found value of type or else ''", - "componentRuleId": "Strain.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Doses_mg_per_kg_bw", - "componentValues": [ - { - "valueId": null, - "value": "", - "originalValue": "", - "valueDescription": "Joining all values of type with ' '", - "componentRuleId": "Necropsy.1.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Mortality_Statement", - "componentValues": [ - { - "valueId": null, - "value": "", - "originalValue": "", - "valueDescription": "Joining all values of type with ' '", - "componentRuleId": "MortalityStatement.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Weight_Behavior_Changes", - "componentValues": [ - { - "valueId": null, - "value": "", - "originalValue": "", - "valueDescription": "Joining all values of type with '\n'", - "componentRuleId": "WeightBehavior.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Necropsy_Findings", - "componentValues": [ - { - "valueId": null, - "value": "", - "originalValue": "", - "valueDescription": "Joining all values of type with ' '", - "componentRuleId": "Necropsy.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Deviation_from_the_Guideline", - "componentValues": [ - { - "valueId": null, - "value": "", - "originalValue": "", - "valueDescription": "Joining all values of type with '\n'", - "componentRuleId": "GuidelineDeviation.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Conclusion_LD50_Greater_than", - "componentValues": [ - { - "valueId": null, - "value": "", - "originalValue": "", - "valueDescription": "No entity of type 'ld50_greater' found", - "componentRuleId": "Conclusion.1.1", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Conclusion_LD50_mg_per_kg", - "componentValues": [ - { - "valueId": null, - "value": "", - "originalValue": "", - "valueDescription": "Joining all unique values of type with ', '", - "componentRuleId": "Conclusion.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Conclusion_Minimum_Confidence", - "componentValues": [ - { - "valueId": null, - "value": "", - "originalValue": "", - "valueDescription": "Joining all unique values of type with ', '", - "componentRuleId": "Conclusion.2.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Conclusion_Maximum_Confidence", - "componentValues": [ - { - "valueId": null, - "value": "", - "originalValue": "", - "valueDescription": "Joining all unique values of type with ', '", - "componentRuleId": "Conclusion.3.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Study_Conclusion", - "componentValues": [ - { - "valueId": null, - "value": "", - "originalValue": "", - "valueDescription": "Joining all values of type with ' '", - "componentRuleId": "StudyConclusion.0.0", - "componentLogEntityReferences": [] - } - ] - } - ] -} \ No newline at end of file diff --git a/persistence-service-v1/persistence-service-server-v1/src/test/resources/files/componentlog/componentOverrideExample.json b/persistence-service-v1/persistence-service-server-v1/src/test/resources/files/componentlog/componentOverrideExample.json deleted file mode 100644 index e78ce1ef0..000000000 --- a/persistence-service-v1/persistence-service-server-v1/src/test/resources/files/componentlog/componentOverrideExample.json +++ /dev/null @@ -1,244 +0,0 @@ -{ - "componentOverrides": [ - { - "name": "Study_Title", - "componentValues": [ - { - "valueId": "1", - "value": "", - "valueDescription": "First found value of type or else ''", - "componentRuleId": "StudyTitle.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Performing_Laboratory", - "componentValues": [ - { - "valueId": "2", - "value": "", - "valueDescription": "fallback", - "componentRuleId": "PerformingLaboratory.0.2", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Report_Number", - "componentValues": [ - { - "valueId": "3", - "value": "", - "valueDescription": "First found value of type or else ''", - "componentRuleId": "ReportNumber.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "GLP_Study", - "componentValues": [ - { - "valueId": "4", - "value": "No", - "valueDescription": "Yes if present, No if not", - "componentRuleId": "GLPStudy.1.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Test_Guidelines_2", - "componentValues": [ - { - "valueId": "5", - "value": "", - "valueDescription": "Joining all values of type with ', '", - "componentRuleId": "TestGuideline.2.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Experimental_Starting_Date", - "componentValues": [ - { - "valueId": "6", - "value": "", - "valueDescription": "Convert values of type '' to dd/MM/yyyy joined with ', '", - "componentRuleId": "StartDate.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Experimental_Completion_Date", - "componentValues": [ - { - "valueId": "7", - "value": "", - "valueDescription": "Convert values of type '' to dd/MM/yyyy joined with ', '", - "componentRuleId": "CompletionDate.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Certificate_of_Analysis_Batch_Identification", - "componentValues": [ - { - "valueId": "8", - "value": "", - "valueDescription": "Joining all unique values of type with ', '", - "componentRuleId": "AnalysisCertificate.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Species", - "componentValues": [ - { - "valueId": "9", - "value": "", - "valueDescription": "First found value of type or else ''", - "componentRuleId": "Species.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Strain", - "componentValues": [ - { - "valueId": "10", - "value": "", - "valueDescription": "First found value of type or else ''", - "componentRuleId": "Strain.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Doses_mg_per_kg_bw", - "componentValues": [ - { - "valueId": "11", - "value": "", - "valueDescription": "Joining all values of type with ' '", - "componentRuleId": "Necropsy.1.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Mortality_Statement", - "componentValues": [ - { - "valueId": "12", - "value": "", - "valueDescription": "Joining all values of type with ' '", - "componentRuleId": "MortalityStatement.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Weight_Behavior_Changes", - "componentValues": [ - { - "valueId": "13", - "value": "", - "valueDescription": "Joining all values of type with '\n'", - "componentRuleId": "WeightBehavior.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Necropsy_Findings", - "componentValues": [ - { - "valueId": "14", - "value": "", - "valueDescription": "Joining all values of type with ' '", - "componentRuleId": "Necropsy.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Deviation_from_the_Guideline", - "componentValues": [ - { - "valueId": "15", - "value": "", - "valueDescription": "Joining all values of type with '\n'", - "componentRuleId": "GuidelineDeviation.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Conclusion_LD50_Greater_than", - "componentValues": [ - { - "valueId": "16", - "value": "", - "valueDescription": "No entity of type 'ld50_greater' found", - "componentRuleId": "Conclusion.1.1", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Conclusion_LD50_mg_per_kg", - "componentValues": [ - { - "valueId": "17", - "value": "", - "valueDescription": "Joining all unique values of type with ', '", - "componentRuleId": "Conclusion.0.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Conclusion_Minimum_Confidence", - "componentValues": [ - { - "valueId": "18", - "value": "", - "valueDescription": "Joining all unique values of type with ', '", - "componentRuleId": "Conclusion.2.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Conclusion_Maximum_Confidence", - "componentValues": [ - { - "valueId": "19", - "value": "", - "valueDescription": "Joining all unique values of type with ', '", - "componentRuleId": "Conclusion.3.0", - "componentLogEntityReferences": [] - } - ] - }, - { - "name": "Study_Conclusion", - "componentValues": [ - { - "valueId": "20", - "value": "", - "valueDescription": "Joining all values of type with ' '", - "componentRuleId": "StudyConclusion.0.0", - "componentLogEntityReferences": [] - } - ] - } - ] -} \ No newline at end of file