diff --git a/docs/about/naming_rest_api_excel_guide.docx b/docs/about/naming_rest_api_excel_guide.docx index 1145e4371e1460ed56ed29ce135149947d9f445e..8651ce1f0ad649df65addc51a2c09c0117f36722 100644 Binary files a/docs/about/naming_rest_api_excel_guide.docx and b/docs/about/naming_rest_api_excel_guide.docx differ diff --git a/docs/about/naming_rest_api_excel_guide.pdf b/docs/about/naming_rest_api_excel_guide.pdf index 655a029d74b7cfd0c3859cca0bd823716f07c686..28fead09929b09debb88f023da259fff60ca996d 100644 Binary files a/docs/about/naming_rest_api_excel_guide.pdf and b/docs/about/naming_rest_api_excel_guide.pdf differ diff --git a/src/main/java/org/openepics/names/rest/api/v1/INames.java b/src/main/java/org/openepics/names/rest/api/v1/INames.java index ddc6d88965de367bff59262b6745a37ef91a1573..e91f96b1ba5592a8a17852bd7ca4249ce89e8018 100644 --- a/src/main/java/org/openepics/names/rest/api/v1/INames.java +++ b/src/main/java/org/openepics/names/rest/api/v1/INames.java @@ -79,7 +79,6 @@ public interface INames { deviceStructure (String) name (String) status (Status) - latest (Boolean) deleted (Boolean) when (Date) who (String) @@ -112,8 +111,7 @@ public interface INames { user - create, update, delete ( administrator ) default for read is to have lifecycle attributes unless query for specific resource or specific use case - latest, deleted - note - latest handled by history + status, deleted */ public static final String DEFAULT_PAGE = "0"; diff --git a/src/main/java/org/openepics/names/rest/api/v1/IStructures.java b/src/main/java/org/openepics/names/rest/api/v1/IStructures.java index 5a5def29dba5b2b114d0d18674e87176244aa409..8b8f68503e253d19b30af69ddee7147c7ee38392 100644 --- a/src/main/java/org/openepics/names/rest/api/v1/IStructures.java +++ b/src/main/java/org/openepics/names/rest/api/v1/IStructures.java @@ -80,7 +80,6 @@ public interface IStructures { mnemonicPath (String) level (Integer) status (Status) - latest (Boolean) deleted (Boolean) when (Date) who (String) @@ -112,8 +111,7 @@ public interface IStructures { ( user ) administrator - create, update, delete default for read is to have lifecycle attributes unless query for specific resource or specific use case - latest, deleted - note - latest handled by history + status, deleted mnemonic path for structure includes all levels of mnemonics */ diff --git a/src/main/java/org/openepics/names/rest/beans/element/NameElement.java b/src/main/java/org/openepics/names/rest/beans/element/NameElement.java index bfa1e34ecaedf07303bc63ee4ce1d77e3bfd7be2..db1bf3279a82272faeb5fffce3f806a15744c249 100644 --- a/src/main/java/org/openepics/names/rest/beans/element/NameElement.java +++ b/src/main/java/org/openepics/names/rest/beans/element/NameElement.java @@ -52,8 +52,6 @@ public class NameElement extends NameElementCommand implements Serializable { private String name; @Schema(description = "Status of the name entry.") private Status status; - @Schema(description = "If the name entry is latest (with status APPROVED) in its line of entries.") - private Boolean latest; @Schema(description = "If the name entry is deleted.") private Boolean deleted; @Schema(description = "Date and time when the name entry was created.") @@ -82,7 +80,6 @@ public class NameElement extends NameElementCommand implements Serializable { * @param deviceStructure device structure mnemonic path * @param name name * @param status status - * @param latest latest * @param deleted deleted * @param when when * @param who who @@ -92,14 +89,13 @@ public class NameElement extends NameElementCommand implements Serializable { UUID uuid, UUID parentSystemStructure, UUID parentDeviceStructure, String index, String description, String systemStructure, String deviceStructure, String name, - Status status, Boolean latest, Boolean deleted, + Status status, Boolean deleted, Date when, String who, String comment) { super(uuid, parentSystemStructure, parentDeviceStructure, index, description); this.systemStructure = systemStructure; this.deviceStructure = deviceStructure; this.name = name; this.status = status; - this.latest = latest; this.deleted = deleted; this.when = when; this.who = who; @@ -130,12 +126,6 @@ public class NameElement extends NameElementCommand implements Serializable { public void setStatus(Status status) { this.status = status; } - public Boolean isLatest() { - return latest; - } - public void setLatest(Boolean latest) { - this.latest = latest; - } public Boolean isDeleted() { return deleted; } @@ -201,11 +191,6 @@ public class NameElement extends NameElementCommand implements Serializable { return false; } else if (!getStatus().equals(other.getStatus())) return false; - if (isLatest() == null) { - if (other.isLatest() != null) - return false; - } else if (!isLatest().equals(other.isLatest())) - return false; if (isDeleted() == null) { if (other.isDeleted() != null) return false; @@ -248,7 +233,6 @@ public class NameElement extends NameElementCommand implements Serializable { sb.append(", \"description\": " + getDescription()); sb.append(", \"name\": " + getName()); sb.append(", \"status\": " + getStatus()); - sb.append(", \"latest\": " + isLatest()); sb.append(", \"deleted\": " + isDeleted()); sb.append(", \"when\": " + getWhen()); sb.append(", \"who\": " + getWho()); @@ -263,7 +247,6 @@ public class NameElement extends NameElementCommand implements Serializable { sb.append("\"uuid\": " + getUuid()); sb.append(", \"name\": " + getName()); sb.append(", \"status\": " + getStatus()); - sb.append(", \"latest\": " + isLatest()); sb.append(", \"deleted\": " + isDeleted()); sb.append("}"); return sb.toString(); diff --git a/src/main/java/org/openepics/names/rest/beans/element/StructureElement.java b/src/main/java/org/openepics/names/rest/beans/element/StructureElement.java index f9c512b0e149a15eefbb13298de73c210e61c03d..8a24a8ca45bb8d22cf1c354dd19b62babdfbb61e 100644 --- a/src/main/java/org/openepics/names/rest/beans/element/StructureElement.java +++ b/src/main/java/org/openepics/names/rest/beans/element/StructureElement.java @@ -51,8 +51,6 @@ public class StructureElement extends StructureElementCommand implements Seriali private Integer level; @Schema(description = "Status of the structure entry.") private Status status; - @Schema(description = "If the structure entry is latest (with status APPROVED) in its line of entries.") - private Boolean latest; @Schema(description = "If the structure entry is deleted.") private Boolean deleted; @Schema(description = "Date and time when the structure entry was created.") @@ -81,7 +79,6 @@ public class StructureElement extends StructureElementCommand implements Seriali * @param mnemonicPath mnemonic path * @param level level * @param status status - * @param latest latest * @param deleted deleted * @param when when * @param who who @@ -91,13 +88,12 @@ public class StructureElement extends StructureElementCommand implements Seriali UUID uuid, Type type, UUID parent, String mnemonic, Integer ordering, String description, String mnemonicPath, Integer level, - Status status, Boolean latest, Boolean deleted, + Status status, Boolean deleted, Date when, String who, String comment) { super(uuid, type, parent, mnemonic, ordering, description); this.mnemonicPath = mnemonicPath; this.level = level; this.status = status; - this.latest = latest; this.deleted = deleted; this.when = when; this.who = who; @@ -122,12 +118,6 @@ public class StructureElement extends StructureElementCommand implements Seriali public void setStatus(Status status) { this.status = status; } - public Boolean isLatest() { - return latest; - } - public void setLatest(Boolean latest) { - this.latest = latest; - } public Boolean isDeleted() { return deleted; } @@ -188,11 +178,6 @@ public class StructureElement extends StructureElementCommand implements Seriali return false; } else if (!getStatus().equals(other.getStatus())) return false; - if (isLatest() == null) { - if (other.isLatest() != null) - return false; - } else if (!isLatest().equals(other.isLatest())) - return false; if (isDeleted() == null) { if (other.isDeleted() != null) return false; @@ -235,7 +220,6 @@ public class StructureElement extends StructureElementCommand implements Seriali sb.append(", \"level\": " + getLevel()); sb.append(", \"description\": " + getDescription()); sb.append(", \"status\": " + getStatus()); - sb.append(", \"latest\": " + isLatest()); sb.append(", \"deleted\": " + isDeleted()); sb.append(", \"when\": " + getWhen()); sb.append(", \"who\": " + getWho()); @@ -251,7 +235,6 @@ public class StructureElement extends StructureElementCommand implements Seriali sb.append(", \"type\": " + getType()); sb.append(", \"mnemonic\": " + getMnemonic()); sb.append(", \"status\": " + getStatus()); - sb.append(", \"latest\": " + isLatest()); sb.append(", \"deleted\": " + isDeleted()); sb.append("}"); return sb.toString(); diff --git a/src/main/java/org/openepics/names/rest/controller/ReportController.java b/src/main/java/org/openepics/names/rest/controller/ReportController.java index c6fdba20730afc2b8c52070eb24ff827c39b8f1a..ebc3aae0d371216c614e005fea788a5bd01537fb 100644 --- a/src/main/java/org/openepics/names/rest/controller/ReportController.java +++ b/src/main/java/org/openepics/names/rest/controller/ReportController.java @@ -144,10 +144,10 @@ public class ReportController { public String reportAbout() { // report metrics about Naming // ess names - // read latest, latest deleted, latest not deleted + // read valid, valid deleted, valid not deleted // count for kind of name // system structure, device structure - // read latest per structure + // read valid per structure // count for status // // note @@ -163,7 +163,7 @@ public class ReportController { // report // prepare metrics - // read names - latest, latest deleted, latest not deleted + // read names - valid, valid deleted, valid not deleted // count names - kind of name // count names - history ResponsePageNameElements nameElementsEssNames = namesService.readNames(null, null, null, null, null, null, null, null, Boolean.FALSE, null, null, null, null); @@ -174,7 +174,7 @@ public class ReportController { HolderReportName holderReportName = new HolderReportName(nameElementsEssNamesNotDeleted); // prepare metrics - // read structures - latest + // read structures - valid // count structures - status // count structures - history ResponsePageStructureElements structureElementsSystemGroup = structuresService.readStructures(Type.SYSTEMGROUP, null, null, null, null, null, null, null, Boolean.FALSE, null, null, null, null, StructureChoice.STRUCTURE); @@ -283,7 +283,7 @@ public class ReportController { .append(DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL).format(new Date())).append(NEWLINE) .append(DIVIDER_128).append(NEWLINE) .append("Name and structure data are displayed per line of uuid which is unique identifier through lifecycle of entry.").append(NEWLINE) - .append("Note # means number of, active means approved latest not deleted, obsolete values are not shown unless history is requested.").append(NEWLINE) + .append("Note # means number of, active means approved valid not deleted, obsolete values are not shown unless history is requested.").append(NEWLINE) .append(DIVIDER_128).append(NEWLINE) .append("Metrics for Naming").append(NEWLINE) .append(" 1) # entries - Overview").append(NEWLINE) @@ -478,15 +478,12 @@ public class ReportController { addOne(structureElement.getUuid(), mapUuidCount); if (Status.APPROVED.equals(structureElement.getStatus()) - && Boolean.TRUE.equals(structureElement.isLatest()) && Boolean.FALSE.equals(structureElement.isDeleted())) { nbrActive++; } else if (Status.APPROVED.equals(structureElement.getStatus()) - && Boolean.TRUE.equals(structureElement.isLatest()) && Boolean.TRUE.equals(structureElement.isDeleted())) { nbrDeleted++; - } else if (Boolean.TRUE.equals(structureElement.isLatest()) - && Boolean.TRUE.equals(structureElement.isDeleted())) { + } else if (Boolean.TRUE.equals(structureElement.isDeleted())) { // ref. V5__Data_transformation_status_deleted.sql // migration script to transform data to not rely on status attribute nbrDeleted++; diff --git a/src/main/java/org/openepics/names/util/ExcelUtil.java b/src/main/java/org/openepics/names/util/ExcelUtil.java index aa6765b0fc2f9769d646823b29ab1b3e33a02ee3..80c2ab75f5b31e37b9ceeb2265e794622205a80b 100644 --- a/src/main/java/org/openepics/names/util/ExcelUtil.java +++ b/src/main/java/org/openepics/names/util/ExcelUtil.java @@ -82,7 +82,6 @@ public class ExcelUtil { {"DeviceStructure", "Mnemonic path for for the device structure."}, {"Name", "Name (verbose) of the name entry."}, {"Status", "Status of the name entry."}, - {"Latest", "If the name entry is latest (with status APPROVED) in its line of entries."}, {"Deleted", "If the name entry is deleted."}, {"When", "Date and time when the name entry was created."}, {"Who", "Name (user) of who created the name entry."}, @@ -100,7 +99,6 @@ public class ExcelUtil { {"MnemonicPath", "Mnemonic path of the structure entry."}, {"Level", "Level of the structure entry."}, {"Status", "Status of the structure entry."}, - {"Latest", "If the structure entry is latest (with status APPROVED) in its line of entries."}, {"Deleted", "If the structure entry is deleted."}, {"When", "Date and time when the structure entry was created."}, {"Who", "Name (user) of who created the structure entry."}, @@ -492,18 +490,15 @@ public class ExcelUtil { cell.setCellValue(nameElement.getStatus() != null ? nameElement.getStatus().toString() : null); break; case 9: - cell.setCellValue(nameElement.isLatest()); - break; - case 10: cell.setCellValue(nameElement.isDeleted()); break; - case 11: + case 10: cell.setCellValue(DateFormat.getDateTimeInstance().format(nameElement.getWhen())); break; - case 12: + case 11: cell.setCellValue(nameElement.getWho()); break; - case 13: + case 12: cell.setCellValue(nameElement.getComment()); break; default: @@ -619,18 +614,15 @@ public class ExcelUtil { cell.setCellValue(structureElement.getStatus() != null ? structureElement.getStatus().toString() : null); break; case 9: - cell.setCellValue(structureElement.isLatest()); - break; - case 10: cell.setCellValue(structureElement.isDeleted()); break; - case 11: + case 10: cell.setCellValue(DateFormat.getDateTimeInstance().format(structureElement.getWhen())); break; - case 12: + case 11: cell.setCellValue(structureElement.getWho()); break; - case 13: + case 12: cell.setCellValue(structureElement.getComment()); break; default: diff --git a/src/main/java/org/openepics/names/util/NameElementUtil.java b/src/main/java/org/openepics/names/util/NameElementUtil.java index 1e511320edccbecebb3fdce9937dadf390435569..39aeec0b591960c68264ea85ff0ae5e1f3dc6053 100644 --- a/src/main/java/org/openepics/names/util/NameElementUtil.java +++ b/src/main/java/org/openepics/names/util/NameElementUtil.java @@ -87,7 +87,7 @@ public class NameElementUtil { NamingConventionUtil.extractMnemonicPathSystemStructure(name.getConventionName()), NamingConventionUtil.extractMnemonicPathDeviceStructure(name.getConventionName()), name.getConventionName(), - Status.APPROVED, name.isLatest(), name.isDeleted(), + Status.APPROVED, name.isDeleted(), name.getRequested(), name.getRequestedBy(), name.getRequestedComment()); } @@ -103,7 +103,6 @@ public class NameElementUtil { * @param deviceStructure device structure mnemonic path * @param name name * @param status status - * @param latest latest * @param deleted deleted * @param when when * @param who who @@ -114,14 +113,14 @@ public class NameElementUtil { UUID uuid, UUID parentSystemStructure, UUID parentDeviceStructure, String index, String description, String systemStructure, String deviceStructure, String name, - Status status, Boolean latest, Boolean deleted, + Status status, Boolean deleted, Date when, String who, String comment) { return new NameElement( uuid, parentSystemStructure, parentDeviceStructure, index, description, systemStructure, deviceStructure, name, - status, latest, deleted, + status, deleted, when, who, comment); } diff --git a/src/main/java/org/openepics/names/util/StructureElementUtil.java b/src/main/java/org/openepics/names/util/StructureElementUtil.java index dff1ff6d9f0f0fe8a8c8bb97b7edcd0ba07a7b1b..15a18f6e7e6214c84123ec7bb32c07856e4fb0fe 100644 --- a/src/main/java/org/openepics/names/util/StructureElementUtil.java +++ b/src/main/java/org/openepics/names/util/StructureElementUtil.java @@ -191,7 +191,7 @@ public class StructureElementUtil { systemGroup.getUuid(), Type.SYSTEMGROUP, null, systemGroup.getMnemonic(), systemGroup.getOrdering(), systemGroup.getDescription(), mnemonicPath, 1, - systemGroup.getStatus(), systemGroup.isLatest(), systemGroup.isDeleted(), + systemGroup.getStatus(), systemGroup.isDeleted(), systemGroup.getProcessed(), systemGroup.getProcessedBy(), systemGroup.getProcessedComment()); } /** @@ -219,7 +219,7 @@ public class StructureElementUtil { system.getUuid(), Type.SYSTEM, system.getParentUuid(), system.getMnemonic(), system.getOrdering(), system.getDescription(), mnemonicPath, 2, - system.getStatus(), system.isLatest(), system.isDeleted(), + system.getStatus(), system.isDeleted(), system.getProcessed(), system.getProcessedBy(), system.getProcessedComment()); } /** @@ -247,7 +247,7 @@ public class StructureElementUtil { subsystem.getUuid(), Type.SUBSYSTEM, subsystem.getParentUuid(), subsystem.getMnemonic(), subsystem.getOrdering(), subsystem.getDescription(), mnemonicPath, 3, - subsystem.getStatus(), subsystem.isLatest(), subsystem.isDeleted(), + subsystem.getStatus(), subsystem.isDeleted(), subsystem.getProcessed(), subsystem.getProcessedBy(), subsystem.getProcessedComment()); } @@ -276,7 +276,7 @@ public class StructureElementUtil { discipline.getUuid(), Type.DISCIPLINE, null, discipline.getMnemonic(), discipline.getOrdering(), discipline.getDescription(), mnemonicPath, 1, - discipline.getStatus(), discipline.isLatest(), discipline.isDeleted(), + discipline.getStatus(), discipline.isDeleted(), discipline.getProcessed(), discipline.getProcessedBy(), discipline.getProcessedComment()); } /** @@ -304,7 +304,7 @@ public class StructureElementUtil { deviceGroup.getUuid(), Type.DEVICEGROUP, deviceGroup.getParentUuid(), deviceGroup.getMnemonic(), deviceGroup.getOrdering(), deviceGroup.getDescription(), mnemonicPath, 2, - deviceGroup.getStatus(), deviceGroup.isLatest(), deviceGroup.isDeleted(), + deviceGroup.getStatus(), deviceGroup.isDeleted(), deviceGroup.getProcessed(), deviceGroup.getProcessedBy(), deviceGroup.getProcessedComment()); } /** @@ -332,7 +332,7 @@ public class StructureElementUtil { deviceType.getUuid(), Type.DEVICETYPE, deviceType.getParentUuid(), deviceType.getMnemonic(), deviceType.getOrdering(), deviceType.getDescription(), mnemonicPath, 3, - deviceType.getStatus(), deviceType.isLatest(), deviceType.isDeleted(), + deviceType.getStatus(), deviceType.isDeleted(), deviceType.getProcessed(), deviceType.getProcessedBy(), deviceType.getProcessedComment()); } @@ -348,7 +348,6 @@ public class StructureElementUtil { * @param mnemonicPath mnemonic path * @param level level * @param status status - * @param latest latest * @param deleted deleted * @param when when * @param who who @@ -359,14 +358,14 @@ public class StructureElementUtil { UUID uuid, Type type, UUID parent, String mnemonic, Integer ordering, String description, String mnemonicPath, Integer level, - Status status, Boolean latest, Boolean deleted, + Status status, Boolean deleted, Date when, String who, String comment) { return new StructureElement( uuid, type, parent, mnemonic, ordering, description, mnemonicPath, level, - status, latest, deleted, + status, deleted, when, who, comment); } diff --git a/src/main/java/org/openepics/names/util/ValidateNameElementUtil.java b/src/main/java/org/openepics/names/util/ValidateNameElementUtil.java index 62c69a7efe4f98688dbc513aa9c8e6d45ab20ea1..304b32cbda5756945cd2b041950fe453e7f38b82 100644 --- a/src/main/java/org/openepics/names/util/ValidateNameElementUtil.java +++ b/src/main/java/org/openepics/names/util/ValidateNameElementUtil.java @@ -41,7 +41,7 @@ public class ValidateNameElementUtil { // uuid, // systemGroup, system, subsystem, deviceType, systemStructure, deviceStructure, // index, description, name, - // status, latest, deleted, + // status, deleted, // when, who, comment // // NameElementCommand @@ -422,7 +422,7 @@ public class ValidateNameElementUtil { throw ExceptionUtil.createDataNotCorrectException(TextUtil.SYSTEM_STRUCTURE_IS_NOT_CORRECT, details, field); } - // ensure that system structure parents and device structure parents are available, latest and not deleted + // ensure that system structure parents and device structure parents are available and not deleted // if device type // if system group // else diff --git a/src/main/java/org/openepics/names/util/ValidateStructureElementUtil.java b/src/main/java/org/openepics/names/util/ValidateStructureElementUtil.java index 84c0e2dd06c81a878c107de0575e70c81b6655a1..9ce5a218306204ae3f74d09505de5be5e8529905 100644 --- a/src/main/java/org/openepics/names/util/ValidateStructureElementUtil.java +++ b/src/main/java/org/openepics/names/util/ValidateStructureElementUtil.java @@ -43,7 +43,7 @@ public class ValidateStructureElementUtil { // type, uuid, parent, // mnemonic, ordering, description, // mnemonic path, level, - // status, latest, deleted, + // status, deleted, // when, who, comment // // StructureElementCommand @@ -276,7 +276,7 @@ public class ValidateStructureElementUtil { // update, delete // definitely (not possibly) // no pending entry waiting to be handled (pending with higher id than currently approved) - // uuid - approved, latest, not deleted - list size 1 + // uuid - approved, not deleted - list size 1 if (ValidateUtil.isAnyNull(structureElementCommand, structureCommand, holderTmpRepositories)) { return; @@ -355,11 +355,11 @@ public class ValidateStructureElementUtil { // // check structure element data in relation to other data // create, update - // parent - (if applicable) approved, latest, not deleted + // parent - (if applicable) approved, not deleted // mnemonic - (if not same) not exists // mnemonic equivalence - (if not same) equivalence not exists // approve - // uuid - pending, not latest, deleted + // uuid - pending, deleted // no or less checks if entry to be deleted - approve (delete) // more or same checks as above if entry is not be deleted - approve (create), approve (update) // need checks as content may have changed from time of create, update, delete to time of approve diff --git a/src/test/java/org/openepics/names/docker/ITUtilNames.java b/src/test/java/org/openepics/names/docker/ITUtilNames.java index fa427dc576e9e8f4b571fd10124371a439e319d2..a35297f51e61ce02283a365c0cfc7a24158aa44c 100644 --- a/src/test/java/org/openepics/names/docker/ITUtilNames.java +++ b/src/test/java/org/openepics/names/docker/ITUtilNames.java @@ -19,7 +19,6 @@ package org.openepics.names.docker; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; @@ -27,14 +26,9 @@ import static org.junit.jupiter.api.Assertions.fail; import java.io.File; import java.io.IOException; import java.net.HttpURLConnection; -import java.util.Map; -import java.util.TreeMap; -import java.util.UUID; -import java.util.Map.Entry; import org.openepics.names.docker.ITUtil.AuthorizationChoice; import org.openepics.names.docker.ITUtil.EndpointChoice; -import org.openepics.names.rest.beans.Status; import org.openepics.names.rest.beans.element.NameElement; import org.openepics.names.rest.beans.element.NameElementCommandConfirm; import org.openepics.names.rest.beans.element.NameElementCommandCreate; @@ -216,9 +210,6 @@ public class ITUtilNames { if (HttpURLConnection.HTTP_OK == expectedResponseCode) { assertTrue(responsePageNameElements.getListSize() > 0); assertNotNull(responsePageNameElements.getList().get(0)); - - // expected value for latest - assertLatest(responsePageNameElements.getList().get(0)); } else if (HttpURLConnection.HTTP_NOT_FOUND == expectedResponseCode){ assertEquals(0, responsePageNameElements.getListSize()); } @@ -277,9 +268,6 @@ public class ITUtilNames { if (expectedLessThanOrEqual >= 0) { assertTrue(responsePageNameElements.getListSize() <= expectedLessThanOrEqual); } - - // expected value for latest for items in list - assertLatest(responsePageNameElements); } return responsePageNameElements; @@ -291,40 +279,6 @@ public class ITUtilNames { return null; } - /** - * Assert that given response name element is latest and not have status {@link Status#PENDING}. - * - * @param actual response name element - */ - public static void assertLatest(NameElement actual) { - assertNotNull(actual); - assertTrue(actual.isLatest()); - } - - /** - * Assert that response page with list of name elements has maximum one entry that is latest - * for any given uuid, which may not have status {@link Status#PENDING}. - * - * @param actual response page with list of name elements - */ - public static void assertLatest(ResponsePageNameElements actual) { - // latest - // status pending not with latest - // maximum one item for any given uuid in list may be latest - - assertNotNull(actual); - Map<UUID, Long> mapUuidCountLatest = new TreeMap<>(); - for (NameElement nameElement : actual.getList()) { - if (nameElement.isLatest()) { - ITUtil.addOne(nameElement.getUuid(), mapUuidCountLatest); - assertNotEquals(Status.PENDING, nameElement.getStatus()); - } - } - for (Entry<UUID, Long> entry : mapUuidCountLatest.entrySet()) { - assertTrue(entry.getValue() <= 1); - } - } - /** * @see ITUtilNames#assertHistory(String, int, int) */ @@ -359,10 +313,6 @@ public class ITUtilNames { if (expectedEqual >= 0) { assertTrue(responsePageNameElements.getListSize() <= expectedEqual); } - - // expected value for latest for items in list - - ITUtilNames.assertLatest(responsePageNameElements); } return responsePageNameElements; @@ -572,7 +522,6 @@ public class ITUtilNames { for (NameElement createdNameElement : nameElements) { assertNotNull(createdNameElement.getUuid()); - assertEquals(Boolean.TRUE, createdNameElement.isLatest()); assertEquals(Boolean.FALSE, createdNameElement.isDeleted()); assertNotNull(createdNameElement.getWhen()); } @@ -639,7 +588,6 @@ public class ITUtilNames { for (NameElement updatedNameElement : nameElements) { assertNotNull(updatedNameElement.getUuid()); - assertEquals(Boolean.TRUE, updatedNameElement.isLatest()); assertEquals(Boolean.FALSE, updatedNameElement.isDeleted()); assertNotNull(updatedNameElement.getWhen()); } diff --git a/src/test/java/org/openepics/names/docker/ITUtilStructures.java b/src/test/java/org/openepics/names/docker/ITUtilStructures.java index 5c3fc955c8739f2e99a3d9f2258bd532760660da..6a7a28cdb0d8a2e31326d8138d43b94a8c746a9f 100644 --- a/src/test/java/org/openepics/names/docker/ITUtilStructures.java +++ b/src/test/java/org/openepics/names/docker/ITUtilStructures.java @@ -19,7 +19,6 @@ package org.openepics.names.docker; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; @@ -27,10 +26,6 @@ import static org.junit.jupiter.api.Assertions.fail; import java.io.File; import java.io.IOException; import java.net.HttpURLConnection; -import java.util.Map; -import java.util.Map.Entry; -import java.util.TreeMap; -import java.util.UUID; import org.openepics.names.docker.ITUtil.AuthorizationChoice; import org.openepics.names.docker.ITUtil.EndpointChoice; @@ -217,9 +212,6 @@ public class ITUtilStructures { if (HttpURLConnection.HTTP_OK == expectedResponseCode) { assertTrue(responsePageStructureElements.getListSize() > 0); assertNotNull(responsePageStructureElements.getList().get(0)); - - // expected value for latest - assertLatest(responsePageStructureElements.getList().get(0)); } else if (HttpURLConnection.HTTP_NOT_FOUND == expectedResponseCode){ assertEquals(0, responsePageStructureElements.getListSize()); } @@ -280,9 +272,6 @@ public class ITUtilStructures { if (expectedLessThanOrEqual >= 0) { assertTrue(responsePageStructureElements.getListSize() <= expectedLessThanOrEqual); } - - // expected value for latest for items in list - assertLatest(responsePageStructureElements); } return responsePageStructureElements; @@ -294,45 +283,6 @@ public class ITUtilStructures { return null; } - /** - * Assert that given response structure element is either latest with status {@link Status#APPROVED} - * or latest with status {@link Status#PENDING}. - * - * @param actual response structure element - */ - public static void assertLatest(StructureElement actual) { - assertNotNull(actual); - assertTrue(actual.isLatest() && Status.APPROVED.equals(actual.getStatus()) - || !actual.isLatest() && ( - Status.PENDING.equals(actual.getStatus()) - || Status.CANCELLED.equals(actual.getStatus()) - || Status.REJECTED.equals(actual.getStatus()))); - } - - /** - * Assert that response page with list of structure elements has maximum one entry that is latest - * for any given uuid, which may not have status {@link Status#PENDING}. - * - * @param actual response page with list of structure elements - */ - public static void assertLatest(ResponsePageStructureElements actual) { - // latest - // status pending not with latest - // maximum one item for any given uuid in list may be latest - - assertNotNull(actual); - Map<UUID, Long> mapUuidCountLatest = new TreeMap<>(); - for (StructureElement structureElement : actual.getList()) { - if (structureElement.isLatest()) { - ITUtil.addOne(structureElement.getUuid(), mapUuidCountLatest); - assertNotEquals(Status.PENDING, structureElement.getStatus()); - } - } - for (Entry<UUID, Long> entry : mapUuidCountLatest.entrySet()) { - assertTrue(entry.getValue() <= 1); - } - } - /** * @see ITUtilStructures#assertHistory(String, int, int) */ @@ -367,9 +317,6 @@ public class ITUtilStructures { if (expectedEqual >= 0) { assertTrue(responsePageStructureElements.getListSize() <= expectedEqual); } - - // expected value for latest for items in list - ITUtilStructures.assertLatest(responsePageStructureElements); } return responsePageStructureElements; @@ -576,7 +523,6 @@ public class ITUtilStructures { for (StructureElement createdStructureElement : structureElements) { assertNotNull(createdStructureElement.getUuid()); assertEquals(Status.APPROVED, createdStructureElement.getStatus()); - assertEquals(Boolean.TRUE, createdStructureElement.isLatest()); assertEquals(Boolean.FALSE, createdStructureElement.isDeleted()); assertNotNull(createdStructureElement.getWhen()); } @@ -644,7 +590,6 @@ public class ITUtilStructures { for (StructureElement updatedStructureElement : structureElements) { assertNotNull(updatedStructureElement.getUuid()); assertEquals(Status.APPROVED, updatedStructureElement.getStatus()); - assertEquals(Boolean.TRUE, updatedStructureElement.isLatest()); assertEquals(Boolean.FALSE, updatedStructureElement.isDeleted()); assertNotNull(updatedStructureElement.getWhen()); } diff --git a/src/test/java/org/openepics/names/rest/beans/element/NameElementTest.java b/src/test/java/org/openepics/names/rest/beans/element/NameElementTest.java index d5a4b22016696ffbbd4f6b3d48386a0156516af3..9bc57087fc873d4af3b929c73dfe7af0ea7348ca 100644 --- a/src/test/java/org/openepics/names/rest/beans/element/NameElementTest.java +++ b/src/test/java/org/openepics/names/rest/beans/element/NameElementTest.java @@ -53,13 +53,13 @@ class NameElementTest { UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null, null, "System structure only", "Acc", null, "Acc", - Status.APPROVED, true, false, + Status.APPROVED, false, date, "test who", null); ne2 = new NameElement( UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null, null, "System structure only", "Acc", null, "Acc", - Status.APPROVED, true, false, + Status.APPROVED, false, date, "test who", null); assertEquals(ne1, ne2); @@ -69,7 +69,7 @@ class NameElementTest { void equalsJson() { ObjectMapper mapper = new ObjectMapper(); NameElement ne1 = null, ne2 = null; - String json = "{\"uuid\": \"45bdc415-cf5a-4650-b6dd-478540830c2a\", \"parentSystemStructure\": \"eb7e55c2-012b-419d-881a-58a858894e92\", \"parentDeviceStructure\": null, \"systemStructure\": \"Acc\", \"deviceStructure\": null, \"index\": null, \"name\": \"Acc\", \"description\": \"System structure only\", \"status\": \"APPROVED\", \"latest\": true, \"deleted\": false, \"when\": null, \"who\": \"test who\", \"comment\": null}"; + String json = "{\"uuid\": \"45bdc415-cf5a-4650-b6dd-478540830c2a\", \"parentSystemStructure\": \"eb7e55c2-012b-419d-881a-58a858894e92\", \"parentDeviceStructure\": null, \"systemStructure\": \"Acc\", \"deviceStructure\": null, \"index\": null, \"name\": \"Acc\", \"description\": \"System structure only\", \"status\": \"APPROVED\", \"deleted\": false, \"when\": null, \"who\": \"test who\", \"comment\": null}"; try { ne1 = mapper.readValue(json, NameElement.class); @@ -102,13 +102,13 @@ class NameElementTest { UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null, null, "System structure only", "Acc", null, "Acc", - Status.APPROVED, true, false, + Status.APPROVED, false, date, "test who", null); ne2 = new NameElement( UUID.fromString("55bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null, null, "System structure only", "Acc", null, "Acc", - Status.APPROVED, true, false, + Status.APPROVED, false, date, "test who", null); assertNotEquals(ne1, ne2); @@ -118,8 +118,8 @@ class NameElementTest { void notEqualsJson() { ObjectMapper mapper = new ObjectMapper(); NameElement ne1 = null, ne2 = null; - String json = "{\"uuid\": \"45bdc415-cf5a-4650-b6dd-478540830c2a\", \"parentSystemStructure\": \"eb7e55c2-012b-419d-881a-58a858894e92\", \"parentDeviceStructure\": null, \"systemStructure\": \"Acc\", \"deviceStructure\": null, \"index\": null, \"name\": \"Acc\", \"description\": \"System structure only\", \"status\": \"APPROVED\", \"latest\": true, \"deleted\": false, \"when\": null, \"who\": \"test who\", \"comment\": null}"; - String json2 = "{\"uuid\": \"55bdc415-cf5a-4650-b6dd-478540830c2a\", \"parentSystemStructure\": \"eb7e55c2-012b-419d-881a-58a858894e92\", \"parentDeviceStructure\": null, \"systemStructure\": \"Acc\", \"deviceStructure\": null, \"index\": null, \"name\": \"Acc\", \"description\": \"System structure only\", \"status\": \"APPROVED\", \"latest\": true, \"deleted\": false, \"when\": null, \"who\": \"test who\", \"comment\": null}"; + String json = "{\"uuid\": \"45bdc415-cf5a-4650-b6dd-478540830c2a\", \"parentSystemStructure\": \"eb7e55c2-012b-419d-881a-58a858894e92\", \"parentDeviceStructure\": null, \"systemStructure\": \"Acc\", \"deviceStructure\": null, \"index\": null, \"name\": \"Acc\", \"description\": \"System structure only\", \"status\": \"APPROVED\", \"deleted\": false, \"when\": null, \"who\": \"test who\", \"comment\": null}"; + String json2 = "{\"uuid\": \"55bdc415-cf5a-4650-b6dd-478540830c2a\", \"parentSystemStructure\": \"eb7e55c2-012b-419d-881a-58a858894e92\", \"parentDeviceStructure\": null, \"systemStructure\": \"Acc\", \"deviceStructure\": null, \"index\": null, \"name\": \"Acc\", \"description\": \"System structure only\", \"status\": \"APPROVED\", \"deleted\": false, \"when\": null, \"who\": \"test who\", \"comment\": null}"; try { ne1 = mapper.readValue(json, NameElement.class); @@ -153,13 +153,13 @@ class NameElementTest { UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null, null, "System structure only", "Acc", null, "Acc", - Status.APPROVED, true, false, + Status.APPROVED, false, date, "test who", null); ne2 = new NameElement( UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null, null, "System structure only", "Acc", null, "Acc", - Status.APPROVED, true, false, + Status.APPROVED, false, date, "test who", null); assertNotNull(ne1); @@ -177,13 +177,13 @@ class NameElementTest { UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null, null, "System structure only", "Acc", null, "Acc", - Status.APPROVED, true, false, + Status.APPROVED, false, date, "test who", null); ne2 = new NameElement( UUID.fromString("55bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null, null, "System structure only", "Acc", null, "Acc", - Status.APPROVED, true, false, + Status.APPROVED, false, date, "test who", null); assertNotNull(ne1); @@ -201,7 +201,7 @@ class NameElementTest { UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null, null, "System structure only", "Acc", null, "Acc", - Status.APPROVED, true, false, + Status.APPROVED, false, date, "test who", null); String str = ne1.toString(); @@ -221,7 +221,7 @@ class NameElementTest { UUID.fromString("45bdc415-cf5a-4650-b6dd-478540830c2a"), UUID.fromString("eb7e55c2-012b-419d-881a-58a858894e92"), null, null, "System structure only", "Acc", null, "Acc", - Status.APPROVED, true, false, + Status.APPROVED, false, date, "test who", null); String str = ne1.toStringSimple(); diff --git a/src/test/java/org/openepics/names/rest/beans/element/StructureElementTest.java b/src/test/java/org/openepics/names/rest/beans/element/StructureElementTest.java index 9454bfbd0716a29906617a52620f03759cc595c1..8736aa1ba6d6798eb08371666e0365f01d40717e 100644 --- a/src/test/java/org/openepics/names/rest/beans/element/StructureElementTest.java +++ b/src/test/java/org/openepics/names/rest/beans/element/StructureElementTest.java @@ -54,13 +54,13 @@ class StructureElementTest { UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"), "AA1", 41, "description", "AA1", 2, - Status.APPROVED, true, false, + Status.APPROVED, false, date, "test who", "comment"); se2 = new StructureElement( UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"), "AA1", 41, "description", "AA1", 2, - Status.APPROVED, true, false, + Status.APPROVED, false, date, "test who", "comment"); assertEquals(se1, se2); @@ -70,7 +70,7 @@ class StructureElementTest { void equalsJson() { ObjectMapper mapper = new ObjectMapper(); StructureElement se1 = null, se2 = null; - String json = "{\"uuid\": \"a14a8565-de10-4026-97e3-ab129ffaba96\", \"type\": \"SYSTEM\", \"parent\": \"05d52f1c-391e-41e3-a48f-dc8f36f8329b\", \"mnemonic\": \"AA1\", \"mnemonicPath\": \"AA1\", \"ordering\": \"41\", \"level\": \"2\", \"description\": \"description\", \"status\": \"APPROVED\", \"latest\": true, \"deleted\": false, \"when\": null, \"who\": \"test who\", \"comment\": \"comment\"};"; + String json = "{\"uuid\": \"a14a8565-de10-4026-97e3-ab129ffaba96\", \"type\": \"SYSTEM\", \"parent\": \"05d52f1c-391e-41e3-a48f-dc8f36f8329b\", \"mnemonic\": \"AA1\", \"mnemonicPath\": \"AA1\", \"ordering\": \"41\", \"level\": \"2\", \"description\": \"description\", \"status\": \"APPROVED\", \"deleted\": false, \"when\": null, \"who\": \"test who\", \"comment\": \"comment\"};"; try { se1 = mapper.readValue(json, StructureElement.class); @@ -103,13 +103,13 @@ class StructureElementTest { UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"), "AA1", 41, "description", "AA1", 2, - Status.APPROVED, true, false, + Status.APPROVED, false, date, "test who", "comment"); se2 = new StructureElement( UUID.fromString("b14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"), "AA1", 41, "description", "AA1", 2, - Status.APPROVED, true, false, + Status.APPROVED, false, date, "test who", "comment"); assertNotEquals(se1, se2); @@ -119,8 +119,8 @@ class StructureElementTest { void notEqualsJson() { ObjectMapper mapper = new ObjectMapper(); StructureElement se1 = null, se2 = null; - String json = "{\"uuid\": \"a14a8565-de10-4026-97e3-ab129ffaba96\", \"type\": \"SYSTEM\", \"parent\": \"05d52f1c-391e-41e3-a48f-dc8f36f8329b\", \"mnemonic\": \"AA1\", \"mnemonicPath\": \"AA1\", \"ordering\": \"41\", \"level\": \"2\", \"description\": \"description\", \"status\": \"APPROVED\", \"latest\": true, \"deleted\": false, \"when\": null, \"who\": \"test who\", \"comment\": \"comment\"};"; - String json2 = "{\"uuid\": \"b14a8565-de10-4026-97e3-ab129ffaba96\", \"type\": \"SYSTEM\", \"parent\": \"05d52f1c-391e-41e3-a48f-dc8f36f8329b\", \"mnemonic\": \"AA1\", \"mnemonicPath\": \"AA1\", \"ordering\": \"41\", \"level\": \"2\", \"description\": \"description\", \"status\": \"APPROVED\", \"latest\": true, \"deleted\": false, \"when\": null, \"who\": \"test who\", \"comment\": \"comment\"};"; + String json = "{\"uuid\": \"a14a8565-de10-4026-97e3-ab129ffaba96\", \"type\": \"SYSTEM\", \"parent\": \"05d52f1c-391e-41e3-a48f-dc8f36f8329b\", \"mnemonic\": \"AA1\", \"mnemonicPath\": \"AA1\", \"ordering\": \"41\", \"level\": \"2\", \"description\": \"description\", \"status\": \"APPROVED\", \"deleted\": false, \"when\": null, \"who\": \"test who\", \"comment\": \"comment\"};"; + String json2 = "{\"uuid\": \"b14a8565-de10-4026-97e3-ab129ffaba96\", \"type\": \"SYSTEM\", \"parent\": \"05d52f1c-391e-41e3-a48f-dc8f36f8329b\", \"mnemonic\": \"AA1\", \"mnemonicPath\": \"AA1\", \"ordering\": \"41\", \"level\": \"2\", \"description\": \"description\", \"status\": \"APPROVED\", \"deleted\": false, \"when\": null, \"who\": \"test who\", \"comment\": \"comment\"};"; try { se1 = mapper.readValue(json, StructureElement.class); @@ -154,13 +154,13 @@ class StructureElementTest { UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"), "AA1", 41, "description", "AA1", 2, - Status.APPROVED, true, false, + Status.APPROVED, false, date, "test who", "comment"); se2 = new StructureElement( UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"), "AA1", 41, "description", "AA1", 2, - Status.APPROVED, true, false, + Status.APPROVED, false, date, "test who", "comment"); assertNotNull(se1); @@ -178,13 +178,13 @@ class StructureElementTest { UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"), "AA1", 41, "description", "AA1", 2, - Status.APPROVED, true, false, + Status.APPROVED, false, date, "test who", "comment"); se2 = new StructureElement( UUID.fromString("b14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"), "AA1", 41, "description", "AA1", 2, - Status.APPROVED, true, false, + Status.APPROVED, false, date, "test who", "comment"); assertNotNull(se1); @@ -202,7 +202,7 @@ class StructureElementTest { UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"), "AA1", 41, "description", "AA1", 2, - Status.APPROVED, true, false, + Status.APPROVED, false, date, "test who", "comment"); String str = se1.toString(); @@ -222,7 +222,7 @@ class StructureElementTest { UUID.fromString("a14a8565-de10-4026-97e3-ab129ffaba96"), Type.SYSTEM, UUID.fromString("05d52f1c-391e-41e3-a48f-dc8f36f8329b"), "AA1", 41, "description", "AA1", 2, - Status.APPROVED, true, false, + Status.APPROVED, false, date, "test who", "comment"); String str = se1.toStringSimple(); diff --git a/src/test/java/org/openepics/names/util/NameElementUtilTest.java b/src/test/java/org/openepics/names/util/NameElementUtilTest.java index 38ce1a5c1860e286db04a8085b7cdc7319fc201a..9d5fcceaf52853faaa59394703232bcf3a5af404 100644 --- a/src/test/java/org/openepics/names/util/NameElementUtilTest.java +++ b/src/test/java/org/openepics/names/util/NameElementUtilTest.java @@ -64,7 +64,6 @@ class NameElementUtilTest { assertEquals(null, nameElement.getName()); assertEquals(null, nameElement.getDescription()); assertEquals(Status.APPROVED, nameElement.getStatus()); - assertEquals(null, nameElement.isLatest()); assertEquals(null, nameElement.isDeleted()); assertEquals(null, nameElement.getWhen()); assertEquals(null, nameElement.getWho()); @@ -85,7 +84,6 @@ class NameElementUtilTest { String deviceStructure = "er"; String name = "ui"; Status status = Status.APPROVED; - Boolean latest = Boolean.TRUE; Boolean deleted = Boolean.FALSE; Date when = new Date(); String who = "as"; @@ -95,7 +93,7 @@ class NameElementUtilTest { uuid, parentSystemStructure, parentDeviceStructure, index, description, systemStructure, deviceStructure, name, - status, latest, deleted, + status, deleted, when, who, comment); assertNotNull(nameElement); @@ -108,7 +106,6 @@ class NameElementUtilTest { assertEquals(name, nameElement.getName()); assertEquals(description, nameElement.getDescription()); assertEquals(status, nameElement.getStatus()); - assertEquals(latest, nameElement.isLatest()); assertEquals(deleted, nameElement.isDeleted()); assertEquals(when, nameElement.getWhen()); assertEquals(who, nameElement.getWho()); @@ -285,7 +282,6 @@ class NameElementUtilTest { String deviceStructure = "er"; String name = "ui"; Status status = Status.APPROVED; - Boolean latest = Boolean.TRUE; Boolean deleted = Boolean.FALSE; Date when = new Date(); String who = "as"; @@ -295,7 +291,7 @@ class NameElementUtilTest { uuid, parentSystemStructure, parentDeviceStructure, index, description, systemStructure, deviceStructure, name, - status, latest, deleted, + status, deleted, when, who, comment); NameElementCommandCreate commandCreate = NameElementUtil.convertElement2CommandCreate(element); @@ -331,7 +327,6 @@ class NameElementUtilTest { String deviceStructure = "er"; String name = "ui"; Status status = Status.APPROVED; - Boolean latest = Boolean.TRUE; Boolean deleted = Boolean.FALSE; Date when = new Date(); String who = "as"; @@ -341,7 +336,7 @@ class NameElementUtilTest { uuid, parentSystemStructure, parentDeviceStructure, index, description, systemStructure, deviceStructure, name, - status, latest, deleted, + status, deleted, when, who, comment); NameElementCommandUpdate commandUpdate = NameElementUtil.convertElement2CommandUpdate(element); @@ -379,7 +374,6 @@ class NameElementUtilTest { String deviceStructure = "er"; String name = "ui"; Status status = Status.APPROVED; - Boolean latest = Boolean.TRUE; Boolean deleted = Boolean.FALSE; Date when = new Date(); String who = "as"; @@ -389,7 +383,7 @@ class NameElementUtilTest { uuid, parentSystemStructure, parentDeviceStructure, index, description, systemStructure, deviceStructure, name, - status, latest, deleted, + status, deleted, when, who, comment); NameElementCommandConfirm commandConfirm = NameElementUtil.convertElement2CommandConfirm(element); diff --git a/src/test/java/org/openepics/names/util/StructureElementUtilTest.java b/src/test/java/org/openepics/names/util/StructureElementUtilTest.java index eda0b66ae900d0c810c5e2001b358d629c5b2aad..361770748cd5dd298820acd91ce8f9c2927d2cd3 100644 --- a/src/test/java/org/openepics/names/util/StructureElementUtilTest.java +++ b/src/test/java/org/openepics/names/util/StructureElementUtilTest.java @@ -58,7 +58,6 @@ class StructureElementUtilTest { String mnemonicPath = "zx"; Integer level = 3; Status status = Status.PENDING; - Boolean latest = Boolean.FALSE; Boolean deleted = Boolean.FALSE; Date when = new Date(); String who = "bn"; @@ -68,7 +67,7 @@ class StructureElementUtilTest { uuid, type, parent, mnemonic, ordering, description, mnemonicPath, level, - status, latest, deleted, + status, deleted, when, who, comment); assertNotNull(structureElement); @@ -81,7 +80,6 @@ class StructureElementUtilTest { assertEquals(level, structureElement.getLevel()); assertEquals(description, structureElement.getDescription()); assertEquals(status, structureElement.getStatus()); - assertEquals(latest, structureElement.isLatest()); assertEquals(deleted, structureElement.isDeleted()); assertEquals(when, structureElement.getWhen()); assertEquals(who, structureElement.getWho()); @@ -302,7 +300,6 @@ class StructureElementUtilTest { String mnemonicPath = "zx"; Integer level = 3; Status status = Status.PENDING; - Boolean latest = Boolean.FALSE; Boolean deleted = Boolean.FALSE; Date when = new Date(); String who = "bn"; @@ -312,7 +309,7 @@ class StructureElementUtilTest { uuid, type, parent, mnemonic, ordering, description, mnemonicPath, level, - status, latest, deleted, + status, deleted, when, who, comment); StructureElementCommandCreate commandCreate = StructureElementUtil.convertElement2CommandCreate(element); @@ -350,7 +347,6 @@ class StructureElementUtilTest { String mnemonicPath = "zx"; Integer level = 3; Status status = Status.PENDING; - Boolean latest = Boolean.FALSE; Boolean deleted = Boolean.FALSE; Date when = new Date(); String who = "bn"; @@ -360,7 +356,7 @@ class StructureElementUtilTest { uuid, type, parent, mnemonic, ordering, description, mnemonicPath, level, - status, latest, deleted, + status, deleted, when, who, comment); StructureElementCommandUpdate commandUpdate = StructureElementUtil.convertElement2CommandUpdate(element); @@ -400,7 +396,6 @@ class StructureElementUtilTest { String mnemonicPath = "zx"; Integer level = 3; Status status = Status.PENDING; - Boolean latest = Boolean.FALSE; Boolean deleted = Boolean.FALSE; Date when = new Date(); String who = "bn"; @@ -410,7 +405,7 @@ class StructureElementUtilTest { uuid, type, parent, mnemonic, ordering, description, mnemonicPath, level, - status, latest, deleted, + status, deleted, when, who, comment); StructureElementCommandConfirm commandConfirm = StructureElementUtil.convertElement2CommandConfirm(element); diff --git a/src/test/java/org/openepics/names/util/UtilitiesTest.java b/src/test/java/org/openepics/names/util/UtilitiesTest.java index 9bea51634af995fa2f697f6e851ad08124b1bb59..8f7ba5d839765291514299f9b8c7e9e458eed3ae 100644 --- a/src/test/java/org/openepics/names/util/UtilitiesTest.java +++ b/src/test/java/org/openepics/names/util/UtilitiesTest.java @@ -112,7 +112,7 @@ class UtilitiesTest { null, null, null, null, null, null, null, null, - null, null, null, + null, null, null, null, null); assertFalse(Utilities.addToCollection(list, structureElement)); @@ -124,7 +124,7 @@ class UtilitiesTest { null, null, null, null, null, null, null, null, - null, null, null, + null, null, null, null, null); assertTrue(Utilities.addToCollection(list, structureElement)); assertEquals(1, list.size()); diff --git a/src/test/resources/data/templates/NameElementCommand_create_name_NameElement.xlsx b/src/test/resources/data/templates/NameElementCommand_create_name_NameElement.xlsx index 3c6da31db53208e5521b92522af74f90f05b61d4..b564da6954897338e2c44ab963093de613298c14 100644 Binary files a/src/test/resources/data/templates/NameElementCommand_create_name_NameElement.xlsx and b/src/test/resources/data/templates/NameElementCommand_create_name_NameElement.xlsx differ diff --git a/src/test/resources/data/templates/StructureElementCommand_create_system_StructureElement.xlsx b/src/test/resources/data/templates/StructureElementCommand_create_system_StructureElement.xlsx index f0753712fc1fc340af9136b851f0eaff5294baf6..d2dc9802b5cc47ed0d81973e4eb8563b80d6adb7 100644 Binary files a/src/test/resources/data/templates/StructureElementCommand_create_system_StructureElement.xlsx and b/src/test/resources/data/templates/StructureElementCommand_create_system_StructureElement.xlsx differ