mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
- group the tests according to structure of the api
- add new tests - update existing ones
This commit is contained in:
@@ -28,9 +28,11 @@ package org.alfresco.rest.rm.community.model.fileplan;
|
||||
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_COMPONENT_ID;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_COUNT;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_DESCRIPTION;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_IDENTIFIER;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_ID_IS_TEMPORARILY_EDITABLE;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_ROOT_NODE_REF;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
@@ -75,4 +77,10 @@ public class FilePlanProperties extends TestModel
|
||||
/************************/
|
||||
@JsonProperty (PROPERTIES_COUNT)
|
||||
private Integer count;
|
||||
|
||||
@JsonProperty (PROPERTIES_TITLE)
|
||||
private String title;
|
||||
|
||||
@JsonProperty (PROPERTIES_DESCRIPTION)
|
||||
private String description;
|
||||
}
|
||||
|
@@ -96,9 +96,6 @@ public class UnfiledContainerChild extends TestModel
|
||||
@JsonProperty
|
||||
private List<String> aspectNames;
|
||||
|
||||
@JsonProperty
|
||||
private Boolean hasRetentionSchedule;
|
||||
|
||||
@JsonProperty
|
||||
private Boolean isClosed;
|
||||
|
||||
|
@@ -46,8 +46,8 @@ import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanCo
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_PHYSICAL_SIZE;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_PIXEL_X_DIMENSION;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_PIXEL_Y_DIMENSION;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RECORD_SEARCH_HAS_DISPOSITION_SCHEDULE;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_RESOLUTION_UNIT;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_REVIEW_PERIOD;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_ROOT_NODE_REF;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_SHELF;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_SOFTWARE;
|
||||
@@ -55,7 +55,6 @@ import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanCo
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_TITLE;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_VERSION_LABEL;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_VERSION_TYPE;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_VITAL_RECORD_INDICATOR;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_X_RESOLUTION;
|
||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentFields.PROPERTIES_Y_RESOLUTION;
|
||||
|
||||
@@ -65,7 +64,6 @@ import org.alfresco.rest.rm.community.util.ReviewPeriodSerializer;
|
||||
import org.alfresco.utility.model.TestModel;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -93,9 +91,6 @@ public class UnfiledContainerChildProperties extends TestModel
|
||||
@JsonProperty (required = true, value = PROPERTIES_TITLE)
|
||||
private String title;
|
||||
|
||||
@JsonProperty (required = true, value = PROPERTIES_VITAL_RECORD_INDICATOR)
|
||||
private Boolean vitalRecordIndicator;
|
||||
|
||||
@JsonProperty (required = true, value = PROPERTIES_ROOT_NODE_REF)
|
||||
private String rootNodeRef;
|
||||
|
||||
@@ -105,13 +100,12 @@ public class UnfiledContainerChildProperties extends TestModel
|
||||
@JsonProperty (required = true, value = PROPERTIES_IDENTIFIER)
|
||||
private String identifier;
|
||||
|
||||
@JsonProperty (required = true, value = PROPERTIES_REVIEW_PERIOD)
|
||||
@JsonSerialize (using = ReviewPeriodSerializer.class)
|
||||
private ReviewPeriod reviewPeriod;
|
||||
|
||||
@JsonProperty (required = true, value = PROPERTIES_DESCRIPTION)
|
||||
private String description;
|
||||
|
||||
@JsonProperty (value = PROPERTIES_RECORD_SEARCH_HAS_DISPOSITION_SCHEDULE)
|
||||
private Boolean recordSearchHasDispositionSchedule;
|
||||
|
||||
/*********************************/
|
||||
/** Electronic record parameters */
|
||||
/*********************************/
|
||||
|
@@ -34,6 +34,7 @@ import static org.alfresco.rest.rm.community.util.PojoUtility.toJson;
|
||||
import static org.apache.commons.lang3.StringUtils.EMPTY;
|
||||
import static org.springframework.http.HttpMethod.GET;
|
||||
import static org.springframework.http.HttpMethod.POST;
|
||||
import static org.springframework.http.HttpMethod.PUT;
|
||||
|
||||
import org.alfresco.rest.core.RMRestWrapper;
|
||||
import org.alfresco.rest.rm.community.model.fileplan.FilePlan;
|
||||
@@ -172,4 +173,44 @@ public class FilePlanAPI extends RMModelRequest
|
||||
parameters
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* see {@link #updateFilePlan(FilePlan, String, String)
|
||||
*/
|
||||
public FilePlan updateFilePlan(FilePlan filePlanModel, String filePlanId) throws Exception
|
||||
{
|
||||
mandatoryObject("filePlanModel", filePlanModel);
|
||||
mandatoryString("filePlanId", filePlanId);
|
||||
|
||||
return updateFilePlan(filePlanModel, filePlanId, EMPTY);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a file plan.
|
||||
*
|
||||
* @param filePlanModel The file plan model which holds the information
|
||||
* @param filePlanId The identifier of the file plan
|
||||
* @param parameters The URL parameters to add
|
||||
* @throws Exception for the following cases:
|
||||
* <ul>
|
||||
* <li>the update request is invalid or {@code filePlanId} is not a valid format or {@code filePlanModel} is invalid</li>
|
||||
* <li>authentication fails</li>
|
||||
* <li>current user does not have permission to update {@code filePlanId}</li>
|
||||
* <li>{@code filePlanId} does not exist</li>
|
||||
* <li>model integrity exception, including file name with invalid characters</li>
|
||||
* </ul>
|
||||
*/
|
||||
public FilePlan updateFilePlan(FilePlan filePlanModel, String filePlanId, String parameters) throws Exception
|
||||
{
|
||||
mandatoryObject("filePlanModel", filePlanModel);
|
||||
mandatoryString("filePlanId", filePlanId);
|
||||
|
||||
return getRmRestWrapper().processModel(FilePlan.class, requestWithBody(
|
||||
PUT,
|
||||
toJson(filePlanModel),
|
||||
"file-plans/{filePlanId}?{parameters}",
|
||||
filePlanId,
|
||||
parameters));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -263,7 +263,7 @@ public class RecordFolderAPI extends RMModelRequest
|
||||
* Creates a record in a record folder child, i.e. a record.
|
||||
*
|
||||
* @param recordModel The record model which holds the information
|
||||
* @param recordfolderId The identifier of a record folder
|
||||
* @param recordFolderId The identifier of a record folder
|
||||
* @param parameters The URL parameters to add
|
||||
* @return The created {@link Record}
|
||||
* @throws Exception for the following cases:
|
||||
|
@@ -108,7 +108,7 @@ public class UnfiledContainerAPI extends RMModelRequest
|
||||
}
|
||||
|
||||
/**
|
||||
* see {@link #getRootRecordCategories(String, String)}
|
||||
* see {@link #getUnfiledContainerChildren(String)} (String, String)}
|
||||
*/
|
||||
public UnfiledContainerChildCollection getUnfiledContainerChildren(String unfiledContainerId)
|
||||
{
|
||||
|
Reference in New Issue
Block a user