diff --git a/src/main/java/org/openepics/names/rest/controller/NamesController.java b/src/main/java/org/openepics/names/rest/controller/NamesController.java index 784f2c981661c46573a2f6e6a5d62dd039b1827c..61f92e1463c55a71e3c49379b0672c444960e495 100644 --- a/src/main/java/org/openepics/names/rest/controller/NamesController.java +++ b/src/main/java/org/openepics/names/rest/controller/NamesController.java @@ -160,7 +160,7 @@ public class NamesController implements INames { try { ValidateNameElementUtil.validateNamesInputRead( deleted, - uuid, name, nameEquivalence, systemStructure, deviceStructure, description, + uuid, name, nameEquivalence, systemStructure, deviceStructure, index, description, null, orderBy, isAsc, page, pageSize); diff --git a/src/main/java/org/openepics/names/service/StructuresService.java b/src/main/java/org/openepics/names/service/StructuresService.java index 79eccbc6692b10e09d02ed0579e9ed2e7fec58ee..fb94f92725af2792a1e20ed2e268b612d958810f 100644 --- a/src/main/java/org/openepics/names/service/StructuresService.java +++ b/src/main/java/org/openepics/names/service/StructuresService.java @@ -514,7 +514,6 @@ public class StructuresService { // uuid is in max one structure response = new ResponsePageStructureElements(structureElements, Long.valueOf(structureElements.size()), structureElements.size(), offset, limit); - } return response; diff --git a/src/main/java/org/openepics/names/util/StructureElementUtil.java b/src/main/java/org/openepics/names/util/StructureElementUtil.java index 0fc03b6d1ed07c1843d0427218b9bc22fb23441a..e040e5fdd4033c541117717d879cdc9d43b9284b 100644 --- a/src/main/java/org/openepics/names/util/StructureElementUtil.java +++ b/src/main/java/org/openepics/names/util/StructureElementUtil.java @@ -47,9 +47,6 @@ import com.google.common.collect.Lists; */ public class StructureElementUtil { - // used in handling structure attributes - requested, processed - private static final long THOUSAND_MILLISECONDS = 1000; - /** * This class is not to be instantiated. */ @@ -64,24 +61,21 @@ public class StructureElementUtil { * @param holderStructure holder of system and device structure content * @param structureChoice whether to consider content from structure perspective or history perspective. * Structure perspective gives one StructureElement object (processed). - * History perspective gives two StructureElement objects (requested, processed). + * History perspective gives one or two StructureElement objects (requested, processed). * If choice not given then default as structure perspective (processed). * @return list of structure elements */ public static List<StructureElement> getStructureElementsForSystemGroups(List<SystemGroup> systemGroups, HolderSystemDeviceStructure holderStructure, StructureChoice structureChoice) { List<StructureElement> structureElements = Lists.newArrayList(); for (SystemGroup systemGroup : systemGroups) { - // one or two return elements - // processed != null and processed != requested (> 1s difference) --> two entries (requested, processed) - // processed != null and processed == requested (<= 1s difference) --> one entry (processed initial) - // processed == null --> one entry (requested) + // one or two return elements for history + // processed != null --> two entries (requested, processed) + // processed == null --> one entry (requested) if (StructureChoice.HISTORY.equals(structureChoice)) { - if (systemGroup.getProcessed() != null && ((systemGroup.getProcessed().getTime() - systemGroup.getRequested().getTime()) > THOUSAND_MILLISECONDS)) { + if (systemGroup.getProcessed() != null) { structureElements.add(getStructureElementRequested(systemGroup)); structureElements.add(getStructureElementProcessed(systemGroup, holderStructure, structureChoice)); - } else if (systemGroup.getProcessed() != null && ((systemGroup.getProcessed().getTime() - systemGroup.getRequested().getTime()) <= THOUSAND_MILLISECONDS)) { - structureElements.add(getStructureElementProcessed(systemGroup, holderStructure, structureChoice)); } else { structureElements.add(getStructureElementRequested(systemGroup)); } @@ -102,24 +96,21 @@ public class StructureElementUtil { * @param holderStructure holder of system and device structure content * @param structureChoice whether to consider content from structure perspective or history perspective. * Structure perspective gives one StructureElement object (processed). - * History perspective gives two StructureElement objects (requested, processed). + * History perspective gives one or two StructureElement objects (requested, processed). * If choice not given then default as structure perspective (processed). * @return list of structure elements */ public static List<StructureElement> getStructureElementsForSystems(List<System> systems, HolderSystemDeviceStructure holderStructure, StructureChoice structureChoice) { List<StructureElement> structureElements = Lists.newArrayList(); for (System system : systems) { - // one or two return elements - // processed != null and processed != requested (> 1s difference) --> two entries (requested, processed) - // processed != null and processed == requested (<= 1s difference) --> one entry (processed initial) - // processed == null --> one entry (requested) + // one or two return elements for history + // processed != null --> two entries (requested, processed) + // processed == null --> one entry (requested) if (StructureChoice.HISTORY.equals(structureChoice)) { - if (system.getProcessed() != null && ((system.getProcessed().getTime() - system.getRequested().getTime()) > THOUSAND_MILLISECONDS)) { + if (system.getProcessed() != null) { structureElements.add(getStructureElementRequested(system)); structureElements.add(getStructureElementProcessed(system, holderStructure, structureChoice)); - } else if (system.getProcessed() != null && ((system.getProcessed().getTime() - system.getRequested().getTime()) <= THOUSAND_MILLISECONDS)) { - structureElements.add(getStructureElementProcessed(system, holderStructure, structureChoice)); } else { structureElements.add(getStructureElementRequested(system)); } @@ -140,24 +131,21 @@ public class StructureElementUtil { * @param holderStructure holder of system and device structure content * @param structureChoice whether to consider content from structure perspective or history perspective. * Structure perspective gives one StructureElement object (processed). - * History perspective gives two StructureElement objects (requested, processed). + * History perspective gives one or two StructureElement objects (requested, processed). * If choice not given then default as structure perspective (processed). * @return list of structure elements */ public static List<StructureElement> getStructureElementsForSubsystems(List<Subsystem> subsystems, HolderSystemDeviceStructure holderStructure, StructureChoice structureChoice) { List<StructureElement> structureElements = Lists.newArrayList(); for (Subsystem subsystem : subsystems) { - // one or two return elements - // processed != null and processed != requested (> 1s difference) --> two entries (requested, processed) - // processed != null and processed == requested (<= 1s difference) --> one entry (processed initial) - // processed == null --> one entry (requested) + // one or two return elements for history + // processed != null --> two entries (requested, processed) + // processed == null --> one entry (requested) if (StructureChoice.HISTORY.equals(structureChoice)) { - if (subsystem.getProcessed() != null && ((subsystem.getProcessed().getTime() - subsystem.getRequested().getTime()) > THOUSAND_MILLISECONDS)) { + if (subsystem.getProcessed() != null) { structureElements.add(getStructureElementRequested(subsystem)); structureElements.add(getStructureElementProcessed(subsystem, holderStructure, structureChoice)); - } else if (subsystem.getProcessed() != null && ((subsystem.getProcessed().getTime() - subsystem.getRequested().getTime()) <= THOUSAND_MILLISECONDS)) { - structureElements.add(getStructureElementProcessed(subsystem, holderStructure, structureChoice)); } else { structureElements.add(getStructureElementRequested(subsystem)); } @@ -179,24 +167,21 @@ public class StructureElementUtil { * @param holderStructure holder of system and device structure content * @param structureChoice whether to consider content from structure perspective or history perspective. * Structure perspective gives one StructureElement object (processed). - * History perspective gives two StructureElement objects (requested, processed). + * History perspective gives one or two StructureElement objects (requested, processed). * If choice not given then default as structure perspective (processed). * @return list of structure elements */ public static List<StructureElement> getStructureElementsForDisciplines(List<Discipline> disciplines, HolderSystemDeviceStructure holderStructure, StructureChoice structureChoice) { List<StructureElement> structureElements = Lists.newArrayList(); for (Discipline discipline : disciplines) { - // one or two return elements - // processed != null and processed != requested (> 1s difference) --> two entries (requested, processed) - // processed != null and processed == requested (<= 1s difference) --> one entry (processed initial) - // processed == null --> one entry (requested) + // one or two return elements for history + // processed != null --> two entries (requested, processed) + // processed == null --> one entry (requested) if (StructureChoice.HISTORY.equals(structureChoice)) { - if (discipline.getProcessed() != null && ((discipline.getProcessed().getTime() - discipline.getRequested().getTime()) > THOUSAND_MILLISECONDS)) { + if (discipline.getProcessed() != null) { structureElements.add(getStructureElementRequested(discipline)); structureElements.add(getStructureElementProcessed(discipline, holderStructure, structureChoice)); - } else if (discipline.getProcessed() != null && ((discipline.getProcessed().getTime() - discipline.getRequested().getTime()) <= THOUSAND_MILLISECONDS)) { - structureElements.add(getStructureElementProcessed(discipline, holderStructure, structureChoice)); } else { structureElements.add(getStructureElementRequested(discipline)); } @@ -217,24 +202,21 @@ public class StructureElementUtil { * @param holderStructure holder of system and device structure content * @param structureChoice whether to consider content from structure perspective or history perspective. * Structure perspective gives one StructureElement object (processed). - * History perspective gives two StructureElement objects (requested, processed). + * History perspective gives one or two StructureElement objects (requested, processed). * If choice not given then default as structure perspective (processed). * @return list of structure elements */ public static List<StructureElement> getStructureElementsForDeviceGroups(List<DeviceGroup> deviceGroups, HolderSystemDeviceStructure holderStructure, StructureChoice structureChoice) { List<StructureElement> structureElements = Lists.newArrayList(); for (DeviceGroup deviceGroup : deviceGroups) { - // one or two return elements - // processed != null and processed != requested (> 1s difference) --> two entries (requested, processed) - // processed != null and processed == requested (<= 1s difference) --> one entry (processed initial) - // processed == null --> one entry (requested) + // one or two return elements for history + // processed != null --> two entries (requested, processed) + // processed == null --> one entry (requested) if (StructureChoice.HISTORY.equals(structureChoice)) { - if (deviceGroup.getProcessed() != null && ((deviceGroup.getProcessed().getTime() - deviceGroup.getRequested().getTime()) > THOUSAND_MILLISECONDS)) { + if (deviceGroup.getProcessed() != null) { structureElements.add(getStructureElementRequested(deviceGroup)); structureElements.add(getStructureElementProcessed(deviceGroup, holderStructure, structureChoice)); - } else if (deviceGroup.getProcessed() != null && ((deviceGroup.getProcessed().getTime() - deviceGroup.getRequested().getTime()) <= THOUSAND_MILLISECONDS)) { - structureElements.add(getStructureElementProcessed(deviceGroup, holderStructure, structureChoice)); } else { structureElements.add(getStructureElementRequested(deviceGroup)); } @@ -255,24 +237,21 @@ public class StructureElementUtil { * @param holderStructure holder of system and device structure content * @param structureChoice whether to consider content from structure perspective or history perspective. * Structure perspective gives one StructureElement object (processed). - * History perspective gives two StructureElement objects (requested, processed). + * History perspective gives one or two StructureElement objects (requested, processed). * If choice not given then default as structure perspective (processed). * @return list of structure elements */ public static List<StructureElement> getStructureElementsForDeviceTypes(List<DeviceType> deviceTypes, HolderSystemDeviceStructure holderStructure, StructureChoice structureChoice) { List<StructureElement> structureElements = Lists.newArrayList(); for (DeviceType deviceType : deviceTypes) { - // one or two return elements - // processed != null and processed != requested (> 1s difference) --> two entries (requested, processed) - // processed != null and processed == requested (<= 1s difference) --> one entry (processed initial) - // processed == null --> one entry (requested) + // one or two return elements for history + // processed != null --> two entries (requested, processed) + // processed == null --> one entry (requested) if (StructureChoice.HISTORY.equals(structureChoice)) { - if (deviceType.getProcessed() != null && ((deviceType.getProcessed().getTime() - deviceType.getRequested().getTime()) > THOUSAND_MILLISECONDS)) { + if (deviceType.getProcessed() != null) { structureElements.add(getStructureElementRequested(deviceType)); structureElements.add(getStructureElementProcessed(deviceType, holderStructure, structureChoice)); - } else if (deviceType.getProcessed() != null && ((deviceType.getProcessed().getTime() - deviceType.getRequested().getTime()) <= THOUSAND_MILLISECONDS)) { - structureElements.add(getStructureElementProcessed(deviceType, holderStructure, structureChoice)); } else { structureElements.add(getStructureElementRequested(deviceType)); } diff --git a/src/main/java/org/openepics/names/util/ValidateNameElementUtil.java b/src/main/java/org/openepics/names/util/ValidateNameElementUtil.java index 4d2362c2cd6934009e55311a71b33d819c985f19..aa37d8bac7a735d5c5291990575973432c7d3c39 100644 --- a/src/main/java/org/openepics/names/util/ValidateNameElementUtil.java +++ b/src/main/java/org/openepics/names/util/ValidateNameElementUtil.java @@ -70,6 +70,7 @@ public class ValidateNameElementUtil { * @param nameEquivalence name equivalence * @param systemStructure system structure mnemonic * @param deviceStructure device structure mnemonic + * @param index index * @param description description * @param includeHistory include history * @param orderBy order by @@ -78,7 +79,7 @@ public class ValidateNameElementUtil { * @param limit limit */ public static void validateNamesInputRead(Boolean deleted, - String uuid, String name, String nameEquivalence, String systemStructure, String deviceStructure, String description, + String uuid, String name, String nameEquivalence, String systemStructure, String deviceStructure, String index, String description, Boolean includeHistory, FieldName orderBy, Boolean isAsc, Integer offset, Integer limit) { // validate input diff --git a/src/test/java/org/openepics/names/docker/StructuresDeviceGroupIT.java b/src/test/java/org/openepics/names/docker/StructuresDeviceGroupIT.java index ee720aaf8a98c973edeeb1f0d1773de3150eb4b8..a2b9489bf489a6cfd50365b1a969710fea8d56eb 100644 --- a/src/test/java/org/openepics/names/docker/StructuresDeviceGroupIT.java +++ b/src/test/java/org/openepics/names/docker/StructuresDeviceGroupIT.java @@ -1115,7 +1115,7 @@ class StructuresDeviceGroupIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rsha", 0); ITUtilStructureElement.assertRead("/mnemonicPath/Di-Rsha", 0); - ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1); ITUtilStructureElement.assertExists(Type.DEVICEGROUP, "Di", Boolean.FALSE); @@ -1143,7 +1143,7 @@ class StructuresDeviceGroupIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rsha", 0); ITUtilStructureElement.assertRead("/mnemonicPath/Di-Rsha", 0); - ITUtilStructureElement.assertRead("/history/" + approvedStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + approvedStructureElement.getUuid().toString(), 2); ITUtilStructureElement.assertExists(Type.DEVICEGROUP, "Di", Boolean.FALSE); } catch (Exception e) { @@ -1199,7 +1199,7 @@ class StructuresDeviceGroupIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rshc", 0); ITUtilStructureElement.assertRead("/mnemonicPath/Di-Rshc", 0); - ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1); ITUtilStructureElement.assertExists(Type.DEVICEGROUP, "Di", Boolean.FALSE); @@ -1227,7 +1227,7 @@ class StructuresDeviceGroupIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rshc", 0); ITUtilStructureElement.assertRead("/mnemonicPath/Di-Rshc", 0); - ITUtilStructureElement.assertRead("/history/" + cancelledStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + cancelledStructureElement.getUuid().toString(), 2); ITUtilStructureElement.assertExists(Type.DEVICEGROUP, "Di", Boolean.FALSE); } catch (Exception e) { @@ -1283,7 +1283,7 @@ class StructuresDeviceGroupIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rshr", 0); ITUtilStructureElement.assertRead("/mnemonicPath/Di-Rshr", 0); - ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1); ITUtilStructureElement.assertExists(Type.DEVICEGROUP, "Di", Boolean.FALSE); @@ -1311,7 +1311,7 @@ class StructuresDeviceGroupIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rshr", 0); ITUtilStructureElement.assertRead("/mnemonicPath/Di-Rshr", 0); - ITUtilStructureElement.assertRead("/history/" + rejectedStructureElement.getUuid().toString(), 1); + ITUtilStructureElement.assertRead("/history/" + rejectedStructureElement.getUuid().toString(), 2); ITUtilStructureElement.assertExists(Type.DEVICEGROUP, "Di", Boolean.FALSE); } catch (Exception e) { @@ -1404,12 +1404,10 @@ class StructuresDeviceGroupIT { ITUtilStructureElement.assertRead("/mnemonic/R1", 0); ITUtilStructureElement.assertRead("/mnemonic/A1", 0); - // normally expected number of entries are 1, 2, 2, 2 - // since within 1 second from requested to processed, expected number of entries 1, 1, 1, 1 ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 1); + ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 2); + ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 2); + ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 2); ITUtilStructureElement.assertExists(Type.DEVICEGROUP, "Di", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.DEVICEGROUP, "Di-P1", Boolean.FALSE); @@ -1579,12 +1577,10 @@ class StructuresDeviceGroupIT { ITUtilStructureElement.assertRead("/mnemonic/R9", 0); ITUtilStructureElement.assertRead("/mnemonic/A9", 0); - // normally expected number of entries are 17, 18, 18, 18 - // since within 1 second from requested to processed, expected number of entries 9, 9, 9, 9 - ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 9); - ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 9); - ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 9); - ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 9); + ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 17); + ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 18); + ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 18); + ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 18); ITUtilStructureElement.assertExists(Type.DEVICEGROUP, "Di", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.DEVICEGROUP, "Di-P9", Boolean.FALSE); @@ -1973,8 +1969,8 @@ class StructuresDeviceGroupIT { // history // /history/{uuid} - ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + discipline2Uuid.toString(), 1); + ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 2); + ITUtilStructureElement.assertRead("/history/" + discipline2Uuid.toString(), 2); ITUtilStructureElement.assertExists(Type.DEVICEGROUP, "Di2", Boolean.FALSE); } catch (Exception e) { diff --git a/src/test/java/org/openepics/names/docker/StructuresDeviceTypeIT.java b/src/test/java/org/openepics/names/docker/StructuresDeviceTypeIT.java index 602a9a80d79e8f0bac1abad8486d08b9aae94de0..428c15c2b1fb6a93a36c43d07613423ca8080be2 100644 --- a/src/test/java/org/openepics/names/docker/StructuresDeviceTypeIT.java +++ b/src/test/java/org/openepics/names/docker/StructuresDeviceTypeIT.java @@ -1111,7 +1111,7 @@ class StructuresDeviceTypeIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rsha", 0); ITUtilStructureElement.assertRead("/mnemonicPath/Di-Rsha", 0); - ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1); ITUtilStructureElement.assertExists(Type.DEVICETYPE, "Rsha", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.DEVICETYPE, "Di-Rsha", Boolean.FALSE); @@ -1140,7 +1140,7 @@ class StructuresDeviceTypeIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rsha", 0); ITUtilStructureElement.assertRead("/mnemonicPath/Di-Rsha", 1); - ITUtilStructureElement.assertRead("/history/" + approvedStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + approvedStructureElement.getUuid().toString(), 2); ITUtilStructureElement.assertExists(Type.DEVICETYPE, "Rsha", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.DEVICETYPE, "Di-Rsha", Boolean.TRUE); @@ -1197,7 +1197,7 @@ class StructuresDeviceTypeIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rshc", 0); ITUtilStructureElement.assertRead("/mnemonicPath/Di-Rshc", 0); - ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1); ITUtilStructureElement.assertExists(Type.DEVICETYPE, "Rshc", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.DEVICETYPE, "Di-Rshc", Boolean.FALSE); @@ -1226,7 +1226,7 @@ class StructuresDeviceTypeIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rshc", 0); ITUtilStructureElement.assertRead("/mnemonicPath/Di-Rshc", 0); - ITUtilStructureElement.assertRead("/history/" + cancelledStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + cancelledStructureElement.getUuid().toString(), 2); ITUtilStructureElement.assertExists(Type.DEVICETYPE, "Rshc", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.DEVICETYPE, "Di-Rshc", Boolean.FALSE); @@ -1283,7 +1283,7 @@ class StructuresDeviceTypeIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rshr", 0); ITUtilStructureElement.assertRead("/mnemonicPath/Di-Rshr", 0); - ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1); ITUtilStructureElement.assertExists(Type.DEVICETYPE, "Rshr", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.DEVICETYPE, "Di-Rshr", Boolean.FALSE); @@ -1312,7 +1312,7 @@ class StructuresDeviceTypeIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rshr", 0); ITUtilStructureElement.assertRead("/mnemonicPath/Di-Rshr", 0); - ITUtilStructureElement.assertRead("/history/" + rejectedStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + rejectedStructureElement.getUuid().toString(), 2); ITUtilStructureElement.assertExists(Type.DEVICETYPE, "Rshr", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.DEVICETYPE, "Di-Rshr", Boolean.FALSE); @@ -1406,12 +1406,10 @@ class StructuresDeviceTypeIT { ITUtilStructureElement.assertRead("/mnemonic/R1", 0); ITUtilStructureElement.assertRead("/mnemonic/A1", 1); - // normally expected number of entries are 1, 2, 2, 2 - // since within 1 second from requested to processed, expected number of entries 1, 1, 1, 1 ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 1); + ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 2); + ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 2); + ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 2); ITUtilStructureElement.assertExists(Type.DEVICETYPE, "P1", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.DEVICETYPE, "C1", Boolean.FALSE); @@ -1584,12 +1582,10 @@ class StructuresDeviceTypeIT { ITUtilStructureElement.assertRead("/mnemonic/R9", 1); ITUtilStructureElement.assertRead("/mnemonic/A9", 1); - // normally expected number of entries are 17, 18, 18, 18 - // since within 1 second from requested to processed, expected number of entries 9, 9, 9, 9 - ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 9); - ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 9); - ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 9); - ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 9); + ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 17); + ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 18); + ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 18); + ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 18); ITUtilStructureElement.assertExists(Type.DEVICETYPE, "P9", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.DEVICETYPE, "C9", Boolean.FALSE); @@ -1993,9 +1989,9 @@ class StructuresDeviceTypeIT { // history // /history/{uuid} - ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + deviceGroupUuid.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + disciplineUuid.toString(), 1); + ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 2); + ITUtilStructureElement.assertRead("/history/" + deviceGroupUuid.toString(), 2); + ITUtilStructureElement.assertRead("/history/" + disciplineUuid.toString(), 2); ITUtilStructureElement.assertExists(Type.DEVICETYPE, "Di-AA1", Boolean.TRUE); ITUtilStructureElement.assertExists(Type.DEVICETYPE, "Di-AA2", Boolean.TRUE); diff --git a/src/test/java/org/openepics/names/docker/StructuresDisciplineIT.java b/src/test/java/org/openepics/names/docker/StructuresDisciplineIT.java index c4d962692ac66c712732a21409e3f824d856ca88..df3cddeb79d9221bb60dd92d5697b64afabfa98c 100644 --- a/src/test/java/org/openepics/names/docker/StructuresDisciplineIT.java +++ b/src/test/java/org/openepics/names/docker/StructuresDisciplineIT.java @@ -1042,7 +1042,7 @@ class StructuresDisciplineIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rsha", 0); - ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1); ITUtilStructureElement.assertExists(Type.DISCIPLINE, "Rsha", Boolean.FALSE); @@ -1066,7 +1066,7 @@ class StructuresDisciplineIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rsha", 1); - ITUtilStructureElement.assertRead("/history/" + approvedStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + approvedStructureElement.getUuid().toString(), 2); ITUtilStructureElement.assertExists(Type.DISCIPLINE, "Rsha", Boolean.TRUE); } catch (Exception e) { @@ -1118,7 +1118,7 @@ class StructuresDisciplineIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rshc", 0); - ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1); ITUtilStructureElement.assertExists(Type.DISCIPLINE, "Rshc", Boolean.FALSE); @@ -1142,7 +1142,7 @@ class StructuresDisciplineIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rshc", 0); - ITUtilStructureElement.assertRead("/history/" + cancelledStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + cancelledStructureElement.getUuid().toString(), 2); ITUtilStructureElement.assertExists(Type.DISCIPLINE, "Rshc", Boolean.FALSE); } catch (Exception e) { @@ -1194,7 +1194,7 @@ class StructuresDisciplineIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rshr", 0); - ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1); ITUtilStructureElement.assertExists(Type.DISCIPLINE, "Rshr", Boolean.FALSE); @@ -1218,7 +1218,7 @@ class StructuresDisciplineIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rshr", 0); - ITUtilStructureElement.assertRead("/history/" + rejectedStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + rejectedStructureElement.getUuid().toString(), 2); ITUtilStructureElement.assertExists(Type.DISCIPLINE, "Rshr", Boolean.FALSE); } catch (Exception e) { @@ -1311,12 +1311,10 @@ class StructuresDisciplineIT { ITUtilStructureElement.assertRead("/mnemonic/R1", 0); ITUtilStructureElement.assertRead("/mnemonic/A1", 1); - // normally expected number of entries are 1, 2, 2, 2 - // since within 1 second from requested to processed, expected number of entries 1, 1, 1, 1 ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 1); + ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 2); + ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 2); + ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 2); ITUtilStructureElement.assertExists(Type.DISCIPLINE, "P1", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.DISCIPLINE, "C1", Boolean.FALSE); @@ -1485,12 +1483,10 @@ class StructuresDisciplineIT { ITUtilStructureElement.assertRead("/mnemonic/R9", 1); ITUtilStructureElement.assertRead("/mnemonic/A9", 1); - // normally expected number of entries are 17, 18, 18, 18 - // since within 1 second from requested to processed, expected number of entries 9, 9, 9, 9 - ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 9); - ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 9); - ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 9); - ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 9); + ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 17); + ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 18); + ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 18); + ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 18); ITUtilStructureElement.assertExists(Type.DISCIPLINE, "P9", Boolean.TRUE); ITUtilStructureElement.assertExists(Type.DISCIPLINE, "C9", Boolean.TRUE); @@ -1870,7 +1866,7 @@ class StructuresDisciplineIT { // history // /history/{uuid} - ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 1); + ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 2); ITUtilStructureElement.assertExists(Type.DISCIPLINE, "AA1", Boolean.TRUE); ITUtilStructureElement.assertExists(Type.DISCIPLINE, "AA2", Boolean.TRUE); diff --git a/src/test/java/org/openepics/names/docker/StructuresSubsystemIT.java b/src/test/java/org/openepics/names/docker/StructuresSubsystemIT.java index 503718a21d4aa717e87c0e853ae8a96c1636eeb7..179db02471b1cbba7f1480cc3a7dca7fb50196a1 100644 --- a/src/test/java/org/openepics/names/docker/StructuresSubsystemIT.java +++ b/src/test/java/org/openepics/names/docker/StructuresSubsystemIT.java @@ -1115,7 +1115,7 @@ class StructuresSubsystemIT { ITUtilStructureElement.assertRead("/mnemonicPath/Sys-Rsha", 0); ITUtilStructureElement.assertRead("/mnemonicPath/Sg-Sys-Rsha", 0); - ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1); ITUtilStructureElement.assertExists(Type.SUBSYSTEM, "Rsha", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.SUBSYSTEM, "Sys-Rsha", Boolean.FALSE); @@ -1151,7 +1151,7 @@ class StructuresSubsystemIT { ITUtilStructureElement.assertRead("/mnemonicPath/Sys-Rsha", 1); ITUtilStructureElement.assertRead("/mnemonicPath/Sg-Sys-Rsha", 0); - ITUtilStructureElement.assertRead("/history/" + approvedStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + approvedStructureElement.getUuid().toString(), 2); ITUtilStructureElement.assertExists(Type.SUBSYSTEM, "Rsha", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.SUBSYSTEM, "Sys-Rsha", Boolean.TRUE); @@ -1215,7 +1215,7 @@ class StructuresSubsystemIT { ITUtilStructureElement.assertRead("/mnemonicPath/Sys-Rshc", 0); ITUtilStructureElement.assertRead("/mnemonicPath/Sg-Sys-Rshc", 0); - ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1); ITUtilStructureElement.assertExists(Type.SUBSYSTEM, "Rshc", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.SUBSYSTEM, "Sys-Rshc", Boolean.FALSE); @@ -1251,7 +1251,7 @@ class StructuresSubsystemIT { ITUtilStructureElement.assertRead("/mnemonicPath/Sys-Rshc", 0); ITUtilStructureElement.assertRead("/mnemonicPath/Sg-Sys-Rshc", 0); - ITUtilStructureElement.assertRead("/history/" + cancelledStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + cancelledStructureElement.getUuid().toString(), 2); ITUtilStructureElement.assertExists(Type.SUBSYSTEM, "Rshc", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.SUBSYSTEM, "Sys-Rshc", Boolean.FALSE); @@ -1315,7 +1315,7 @@ class StructuresSubsystemIT { ITUtilStructureElement.assertRead("/mnemonicPath/Sys-Rshr", 0); ITUtilStructureElement.assertRead("/mnemonicPath/Sg-Sys-Rshr", 0); - ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1); ITUtilStructureElement.assertExists(Type.SUBSYSTEM, "Rshr", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.SUBSYSTEM, "Sys-Rshr", Boolean.FALSE); @@ -1351,7 +1351,7 @@ class StructuresSubsystemIT { ITUtilStructureElement.assertRead("/mnemonicPath/Sys-Rshr", 0); ITUtilStructureElement.assertRead("/mnemonicPath/Sg-Sys-Rshr", 0); - ITUtilStructureElement.assertRead("/history/" + rejectedStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + rejectedStructureElement.getUuid().toString(), 2); ITUtilStructureElement.assertExists(Type.SUBSYSTEM, "Rshr", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.SUBSYSTEM, "Sys-Rshr", Boolean.FALSE); @@ -1446,12 +1446,10 @@ class StructuresSubsystemIT { ITUtilStructureElement.assertRead("/mnemonic/R1", 0); ITUtilStructureElement.assertRead("/mnemonic/A1", 1); - // normally expected number of entries are 1, 2, 2, 2 - // since within 1 second from requested to processed, expected number of entries 1, 1, 1, 1 ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 1); + ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 2); + ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 2); + ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 2); ITUtilStructureElement.assertExists(Type.SUBSYSTEM, "P1", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.SUBSYSTEM, "C1", Boolean.FALSE); @@ -1628,12 +1626,10 @@ class StructuresSubsystemIT { ITUtilStructureElement.assertRead("/mnemonic/R9", 1); ITUtilStructureElement.assertRead("/mnemonic/A9", 1); - // normally expected number of entries are 17, 18, 18, 18 - // since within 1 second from requested to processed, expected number of entries 9, 9, 9, 9 - ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 9); - ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 9); - ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 9); - ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 9); + ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 17); + ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 18); + ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 18); + ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 18); ITUtilStructureElement.assertExists(Type.SUBSYSTEM, "P9", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.SUBSYSTEM, "C9", Boolean.FALSE); @@ -2051,9 +2047,9 @@ class StructuresSubsystemIT { // history // /history/{uuid} - ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + systemUuid.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + systemGroupUuid.toString(), 1); + ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 2); + ITUtilStructureElement.assertRead("/history/" + systemUuid.toString(), 2); + ITUtilStructureElement.assertRead("/history/" + systemGroupUuid.toString(), 2); ITUtilStructureElement.assertExists(Type.SUBSYSTEM, "Sys-AA1", Boolean.TRUE); ITUtilStructureElement.assertExists(Type.SUBSYSTEM, "Sys-AA2", Boolean.TRUE); diff --git a/src/test/java/org/openepics/names/docker/StructuresSystemGroupIT.java b/src/test/java/org/openepics/names/docker/StructuresSystemGroupIT.java index fa66419008f16f3f79b685935f216dbb83d2ce8f..739e431568463b7f5f556450ea20a3dff7f6d554 100644 --- a/src/test/java/org/openepics/names/docker/StructuresSystemGroupIT.java +++ b/src/test/java/org/openepics/names/docker/StructuresSystemGroupIT.java @@ -1104,7 +1104,7 @@ class StructuresSystemGroupIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rsha", 0); - ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1); ITUtilStructureElement.assertExists(Type.SYSTEMGROUP, "Rsha", Boolean.FALSE); @@ -1128,7 +1128,7 @@ class StructuresSystemGroupIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rsha", 1); - ITUtilStructureElement.assertRead("/history/" + approvedStructureElement.getUuid().toString(), 1); + ITUtilStructureElement.assertRead("/history/" + approvedStructureElement.getUuid().toString(), 2); ITUtilStructureElement.assertExists(Type.SYSTEMGROUP, "Rsha", Boolean.TRUE); } catch (Exception e) { @@ -1180,7 +1180,7 @@ class StructuresSystemGroupIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rshc", 0); - ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1); ITUtilStructureElement.assertExists(Type.SYSTEMGROUP, "Rshc", Boolean.FALSE); @@ -1204,7 +1204,7 @@ class StructuresSystemGroupIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rshc", 0); - ITUtilStructureElement.assertRead("/history/" + cancelledStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + cancelledStructureElement.getUuid().toString(), 2); ITUtilStructureElement.assertExists(Type.SYSTEMGROUP, "Rshc", Boolean.FALSE); } catch (Exception e) { @@ -1256,7 +1256,7 @@ class StructuresSystemGroupIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rshr", 0); - ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1); ITUtilStructureElement.assertExists(Type.SYSTEMGROUP, "Rshr", Boolean.FALSE); @@ -1280,7 +1280,7 @@ class StructuresSystemGroupIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rshr", 0); - ITUtilStructureElement.assertRead("/history/" + rejectedStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + rejectedStructureElement.getUuid().toString(), 2); ITUtilStructureElement.assertExists(Type.SYSTEMGROUP, "Rshr", Boolean.FALSE); } catch (Exception e) { @@ -1373,12 +1373,10 @@ class StructuresSystemGroupIT { ITUtilStructureElement.assertRead("/mnemonic/R1", 0); ITUtilStructureElement.assertRead("/mnemonic/A1", 1); - // normally expected number of entries are 1, 2, 2, 2 - // since within 1 second from requested to processed, expected number of entries 1, 1, 1, 1 ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 1); + ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 2); + ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 2); + ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 2); ITUtilStructureElement.assertExists(Type.SYSTEMGROUP, "P1", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.SYSTEMGROUP, "C1", Boolean.FALSE); @@ -1547,12 +1545,10 @@ class StructuresSystemGroupIT { ITUtilStructureElement.assertRead("/mnemonic/R9", 1); ITUtilStructureElement.assertRead("/mnemonic/A9", 1); - // normally expected number of entries are 17, 18, 18, 18 - // since within 1 second from requested to processed, expected number of entries 9, 9, 9, 9 - ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 9); - ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 9); - ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 9); - ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 9); + ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 17); + ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 18); + ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 18); + ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 18); ITUtilStructureElement.assertExists(Type.SYSTEMGROUP, "P9", Boolean.TRUE); ITUtilStructureElement.assertExists(Type.SYSTEMGROUP, "C9", Boolean.TRUE); @@ -1932,7 +1928,7 @@ class StructuresSystemGroupIT { // history // /history/{uuid} - ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 1); + ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 2); ITUtilStructureElement.assertExists(Type.SYSTEMGROUP, "AA1", Boolean.TRUE); ITUtilStructureElement.assertExists(Type.SYSTEMGROUP, "AA2", Boolean.TRUE); diff --git a/src/test/java/org/openepics/names/docker/StructuresSystemIT.java b/src/test/java/org/openepics/names/docker/StructuresSystemIT.java index 2930268ae3b4e74c1671961d7414157dd56882a1..df29fcf62b1b6dff8995ccce05b44fc2a6c2b923 100644 --- a/src/test/java/org/openepics/names/docker/StructuresSystemIT.java +++ b/src/test/java/org/openepics/names/docker/StructuresSystemIT.java @@ -1092,7 +1092,7 @@ class StructuresSystemIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rsha", 0); ITUtilStructureElement.assertRead("/mnemonicPath/Sg-Rsha", 0); - ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1); ITUtilStructureElement.assertExists(Type.SYSTEM, "Rsha", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.SYSTEM, "Sg-Rsha", Boolean.FALSE); @@ -1121,7 +1121,7 @@ class StructuresSystemIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rsha", 1); ITUtilStructureElement.assertRead("/mnemonicPath/Sg-Rsha", 0); - ITUtilStructureElement.assertRead("/history/" + approvedStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + approvedStructureElement.getUuid().toString(), 2); ITUtilStructureElement.assertExists(Type.SYSTEM, "Rsha", Boolean.TRUE); ITUtilStructureElement.assertExists(Type.SYSTEM, "Sg-Rsha", Boolean.FALSE); @@ -1178,7 +1178,7 @@ class StructuresSystemIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rshc", 0); ITUtilStructureElement.assertRead("/mnemonicPath/Sg-Rshc", 0); - ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1); ITUtilStructureElement.assertExists(Type.SYSTEM, "Rshc", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.SYSTEM, "Sg-Rshc", Boolean.FALSE); @@ -1207,7 +1207,7 @@ class StructuresSystemIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rshc", 0); ITUtilStructureElement.assertRead("/mnemonicPath/Sg-Rshc", 0); - ITUtilStructureElement.assertRead("/history/" + cancelledStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + cancelledStructureElement.getUuid().toString(), 2); ITUtilStructureElement.assertExists(Type.SYSTEM, "Rshc", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.SYSTEM, "Sg-Rshc", Boolean.FALSE); @@ -1264,7 +1264,7 @@ class StructuresSystemIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rshr", 0); ITUtilStructureElement.assertRead("/mnemonicPath/Sg-Rshr", 0); - ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + createdStructureElement.getUuid().toString(), 1); ITUtilStructureElement.assertExists(Type.SYSTEM, "Rshr", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.SYSTEM, "Sg-Rshr", Boolean.FALSE); @@ -1293,7 +1293,7 @@ class StructuresSystemIT { ITUtilStructureElement.assertRead("/mnemonicPath/Rshr", 0); ITUtilStructureElement.assertRead("/mnemonicPath/Sg-Rshr", 0); - ITUtilStructureElement.assertRead("/history/" + rejectedStructureElement.getUuid().toString(), 1, -1); + ITUtilStructureElement.assertRead("/history/" + rejectedStructureElement.getUuid().toString(), 2); ITUtilStructureElement.assertExists(Type.SYSTEM, "Rshr", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.SYSTEM, "Sg-Rshr", Boolean.FALSE); @@ -1387,12 +1387,10 @@ class StructuresSystemIT { ITUtilStructureElement.assertRead("/mnemonic/R1", 0); ITUtilStructureElement.assertRead("/mnemonic/A1", 1); - // normally expected number of entries are 1, 2, 2, 2 - // since within 1 second from requested to processed, expected number of entries 1, 1, 1, 1 ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 1); + ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 2); + ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 2); + ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 2); ITUtilStructureElement.assertExists(Type.SYSTEM, "P1", Boolean.FALSE); ITUtilStructureElement.assertExists(Type.SYSTEM, "C1", Boolean.FALSE); @@ -1565,12 +1563,10 @@ class StructuresSystemIT { ITUtilStructureElement.assertRead("/mnemonic/R9", 1); ITUtilStructureElement.assertRead("/mnemonic/A9", 1); - // normally expected number of entries are 17, 18, 18, 18 - // since within 1 second from requested to processed, expected number of entries 9, 9, 9, 9 - ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 9); - ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 9); - ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 9); - ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 9); + ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 17); + ITUtilStructureElement.assertRead("/history/" + uuid2.toString(), 18); + ITUtilStructureElement.assertRead("/history/" + uuid3.toString(), 18); + ITUtilStructureElement.assertRead("/history/" + uuid4.toString(), 18); ITUtilStructureElement.assertExists(Type.SYSTEM, "P9", Boolean.TRUE); ITUtilStructureElement.assertExists(Type.SYSTEM, "C9", Boolean.TRUE); @@ -1966,8 +1962,8 @@ class StructuresSystemIT { // history // /history/{uuid} - ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 1); - ITUtilStructureElement.assertRead("/history/" + systemGroupUuid.toString(), 1); + ITUtilStructureElement.assertRead("/history/" + uuid.toString(), 2); + ITUtilStructureElement.assertRead("/history/" + systemGroupUuid.toString(), 2); ITUtilStructureElement.assertExists(Type.SYSTEM, "AA1", Boolean.TRUE); ITUtilStructureElement.assertExists(Type.SYSTEM, "AA2", Boolean.TRUE); diff --git a/src/test/java/org/openepics/names/util/ValidateUtilTest.java b/src/test/java/org/openepics/names/util/ValidateUtilTest.java index 053e2b859d231b589f14f303a4948d8989605869..00fab6391f6a0248774df52f41549af81a168ef1 100644 --- a/src/test/java/org/openepics/names/util/ValidateUtilTest.java +++ b/src/test/java/org/openepics/names/util/ValidateUtilTest.java @@ -636,7 +636,7 @@ class ValidateUtilTest { @Test void validateInputReadNames() { ValidateNameElementUtil.validateNamesInputRead( - null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, null); }