diff --git a/src/main/java/org/alfresco/rest/model/FileplanComponentType.java b/src/main/java/org/alfresco/rest/model/FileplanComponentType.java deleted file mode 100644 index 5811a3f2bf..0000000000 --- a/src/main/java/org/alfresco/rest/model/FileplanComponentType.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * #%L - * Alfresco Records Management Module - * %% - * Copyright (C) 2005 - 2016 Alfresco Software Limited - * %% - * License rights for this program may be obtained from Alfresco Software, Ltd. - * pursuant to a written agreement and any use of this program without such an - * agreement is prohibited. - * #L% - */ -package org.alfresco.rest.model; - -/** - * Fileplan Component Types enum - * - * @author Kristijan Conkas - * @since 2.6 - */ -public enum FileplanComponentType -{ - FILE_PLAN("rma:filePlan"), - RECORD_CATEGORY("rma:recordCategory"), - RECORD_FOLDER("rma:recordFolder"), - HOLD("rma:hold"), - UNFILED_RECORD_FOLDER("rma:unfiledRecordFolder"); - - private String value; - - FileplanComponentType (String value) - { - this.value = value; - } - - public String toString() - { - return this.value; - } -} diff --git a/src/main/java/org/alfresco/rest/requests/RestFilePlanComponentApi.java b/src/main/java/org/alfresco/rest/requests/RestFilePlanComponentApi.java index de3ef604b9..61a629e70e 100644 --- a/src/main/java/org/alfresco/rest/requests/RestFilePlanComponentApi.java +++ b/src/main/java/org/alfresco/rest/requests/RestFilePlanComponentApi.java @@ -22,7 +22,6 @@ import java.util.Map; import org.alfresco.rest.core.RestAPI; import org.alfresco.rest.core.RestRequest; -import org.alfresco.rest.model.FileplanComponentType; import org.alfresco.rest.model.RestFilePlanComponentModel; import org.json.JSONObject; import org.springframework.context.annotation.Scope; @@ -61,14 +60,14 @@ public class RestFilePlanComponentApi extends RestAPI * @throws Exception */ public RestFilePlanComponentModel createFilePlanComponent(String parentFilePlanComponentId, String componentName, - FileplanComponentType componentType, Map properties) throws Exception + String componentType, Map properties) throws Exception { if (componentName == null) throw new IllegalArgumentException("Child component name missing"); JSONObject body = new JSONObject(); body.put("name", componentName); - body.put("nodeType", componentType.toString()); + body.put("nodeType", componentType); if (properties != null) body.put("properties", properties); RestRequest request = requestWithBody(POST, body.toString(), "fileplan-components/{fileplanComponentId}/children", parentFilePlanComponentId); diff --git a/src/test/java/org/alfresco/rest/BaseIgRestTest.java b/src/test/java/org/alfresco/rest/BaseIgRestTest.java index c814ab1196..8dee75f3ff 100644 --- a/src/test/java/org/alfresco/rest/BaseIgRestTest.java +++ b/src/test/java/org/alfresco/rest/BaseIgRestTest.java @@ -38,6 +38,13 @@ public class BaseIgRestTest extends RestTest public static final String ALIAS_UNFILED_RECORDS_CONTAINER = "-unfiled-"; public static final String ALIAS_HOLDS = "-holds-"; + /** Component types. */ + public static final String FILE_PLAN = "rma:filePlan"; + public static final String RECORD_CATEGORY = "rma:recordCategory"; + public static final String RECORD_FOLDER = "rma:recordFolder"; + public static final String HOLD = "rma:hold"; + public static final String UNFILED_RECORD_FOLDER = "rma:unfiledRecordFolder"; + @Value("${alfresco.rm.scheme}") private String scheme; diff --git a/src/test/java/org/alfresco/rest/fileplancomponents/FilePlanComponentsTest.java b/src/test/java/org/alfresco/rest/fileplancomponents/FilePlanTest.java similarity index 86% rename from src/test/java/org/alfresco/rest/fileplancomponents/FilePlanComponentsTest.java rename to src/test/java/org/alfresco/rest/fileplancomponents/FilePlanTest.java index 39ff68f34e..bb85121136 100644 --- a/src/test/java/org/alfresco/rest/fileplancomponents/FilePlanComponentsTest.java +++ b/src/test/java/org/alfresco/rest/fileplancomponents/FilePlanTest.java @@ -11,7 +11,6 @@ */ package org.alfresco.rest.fileplancomponents; -import static org.alfresco.rest.model.FileplanComponentType.FILE_PLAN; import static org.springframework.http.HttpStatus.OK; import static org.testng.Assert.assertEquals; @@ -29,7 +28,7 @@ import org.testng.annotations.Test; * @author Tuna Aksoy * @since 1.0 */ -public class FilePlanComponentsTest extends BaseIgRestTest +public class FilePlanTest extends BaseIgRestTest { @Autowired private RestFilePlanComponentApi filePlanComponentApi; @@ -44,6 +43,6 @@ public class FilePlanComponentsTest extends BaseIgRestTest restWrapper.authenticateUser(dataUser.getAdminUser()); RestFilePlanComponentModel filePlanComponent = filePlanComponentApi.getFilePlanComponent(ALIAS_FILE_PLAN); restWrapper.assertStatusCodeIs(OK); - assertEquals(filePlanComponent.getNodeType(), FILE_PLAN.toString()); + assertEquals(filePlanComponent.getNodeType(), FILE_PLAN); } } diff --git a/src/test/java/org/alfresco/rest/fileplancomponents/RecordCategoryComponentsTest.java b/src/test/java/org/alfresco/rest/fileplancomponents/RecordCategoryTest.java similarity index 96% rename from src/test/java/org/alfresco/rest/fileplancomponents/RecordCategoryComponentsTest.java rename to src/test/java/org/alfresco/rest/fileplancomponents/RecordCategoryTest.java index 7bec99137a..98f8204908 100644 --- a/src/test/java/org/alfresco/rest/fileplancomponents/RecordCategoryComponentsTest.java +++ b/src/test/java/org/alfresco/rest/fileplancomponents/RecordCategoryTest.java @@ -24,7 +24,6 @@ import org.testng.annotations.Test; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertTrue; import static org.testng.Assert.assertNotNull; -import static org.alfresco.rest.model.FileplanComponentType.RECORD_CATEGORY; import static org.springframework.http.HttpStatus.CREATED; import static org.springframework.http.HttpStatus.OK; import static org.springframework.http.HttpStatus.NO_CONTENT; @@ -35,7 +34,7 @@ import static org.springframework.http.HttpStatus.NO_CONTENT; * @author Kristijan Conkas * @since */ -public class RecordCategoryComponentsTest extends BaseIgRestTest +public class RecordCategoryTest extends BaseIgRestTest { @Autowired private RestFilePlanComponentApi filePlanComponentApi;