mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merge branch 'feature/RM-4396_Lombok_UseModelInsteadJsonObject'
Conflicts: rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/fileplancomponents/ElectronicRecordTests.java
This commit is contained in:
@@ -6,3 +6,4 @@
|
|||||||
/.idea/
|
/.idea/
|
||||||
*.iml
|
*.iml
|
||||||
/test-output/
|
/test-output/
|
||||||
|
.factorypath
|
@@ -54,5 +54,11 @@
|
|||||||
<artifactId>fluent-json</artifactId>
|
<artifactId>fluent-json</artifactId>
|
||||||
<version>${fluent.json.version}</version>
|
<version>${fluent.json.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>1.16.10</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
@@ -34,6 +34,11 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POJO for file plan component
|
* POJO for file plan component
|
||||||
*
|
*
|
||||||
@@ -41,6 +46,10 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||||||
* @author Rodica Sutu
|
* @author Rodica Sutu
|
||||||
* @since 2.6
|
* @since 2.6
|
||||||
*/
|
*/
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class FilePlanComponent
|
public class FilePlanComponent
|
||||||
{
|
{
|
||||||
@JsonProperty (required = true)
|
@JsonProperty (required = true)
|
||||||
@@ -84,7 +93,7 @@ public class FilePlanComponent
|
|||||||
|
|
||||||
@JsonProperty (value = ALLOWABLE_OPERATIONS)
|
@JsonProperty (value = ALLOWABLE_OPERATIONS)
|
||||||
private List<String> allowableOperations;
|
private List<String> allowableOperations;
|
||||||
|
|
||||||
@JsonProperty (required = false)
|
@JsonProperty (required = false)
|
||||||
private FilePlanComponentContent content;
|
private FilePlanComponentContent content;
|
||||||
|
|
||||||
@@ -99,324 +108,4 @@ public class FilePlanComponent
|
|||||||
@JsonProperty (required = true)
|
@JsonProperty (required = true)
|
||||||
private FilePlanComponentUserInfo modifiedByUser;
|
private FilePlanComponentUserInfo modifiedByUser;
|
||||||
|
|
||||||
|
|
||||||
/**Helper constructor for creating the file plan component using
|
|
||||||
*
|
|
||||||
* @param name File Plan Component name
|
|
||||||
* @param nodeType File Plan Component node type
|
|
||||||
* @param properties File Plan Component properties
|
|
||||||
*/
|
|
||||||
public FilePlanComponent(String name, String nodeType, FilePlanComponentProperties properties)
|
|
||||||
{
|
|
||||||
this.name = name;
|
|
||||||
this.nodeType = nodeType;
|
|
||||||
this.properties = properties;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper constructor to create empty file plan component
|
|
||||||
*/
|
|
||||||
public FilePlanComponent() { }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper constructor for creating the file plan component using
|
|
||||||
*
|
|
||||||
* @param name File Plan Component name
|
|
||||||
*/
|
|
||||||
public FilePlanComponent(String name)
|
|
||||||
{
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper constructor for creating the file plan component using
|
|
||||||
*
|
|
||||||
* @param name File Plan Component name
|
|
||||||
* @param properties File Plan Component properties
|
|
||||||
*/
|
|
||||||
public FilePlanComponent(String name, FilePlanComponentProperties properties)
|
|
||||||
{
|
|
||||||
this.name = name;
|
|
||||||
this.properties = properties;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the id
|
|
||||||
*/
|
|
||||||
public String getId()
|
|
||||||
{
|
|
||||||
return this.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param id the id to set
|
|
||||||
*/
|
|
||||||
public void setId(String id)
|
|
||||||
{
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the parentId
|
|
||||||
*/
|
|
||||||
public String getParentId()
|
|
||||||
{
|
|
||||||
return this.parentId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param parentId the parentId to set
|
|
||||||
*/
|
|
||||||
public void setParentId(String parentId)
|
|
||||||
{
|
|
||||||
this.parentId = parentId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the name
|
|
||||||
*/
|
|
||||||
public String getName()
|
|
||||||
{
|
|
||||||
return this.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param name the name to set
|
|
||||||
*/
|
|
||||||
public void setName(String name)
|
|
||||||
{
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the nodeType
|
|
||||||
*/
|
|
||||||
public String getNodeType()
|
|
||||||
{
|
|
||||||
return this.nodeType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param nodeType the nodeType to set
|
|
||||||
*/
|
|
||||||
public void setNodeType(String nodeType)
|
|
||||||
{
|
|
||||||
this.nodeType = nodeType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the isCategory
|
|
||||||
*/
|
|
||||||
public Boolean isCategory()
|
|
||||||
{
|
|
||||||
return this.isCategory;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param isCategory the isCategory to set
|
|
||||||
*/
|
|
||||||
public void setCategory(Boolean isCategory)
|
|
||||||
{
|
|
||||||
this.isCategory = isCategory;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the isRecordFolder
|
|
||||||
*/
|
|
||||||
public Boolean isRecordFolder()
|
|
||||||
{
|
|
||||||
return this.isRecordFolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param isRecordFolder the isRecordFolder to set
|
|
||||||
*/
|
|
||||||
public void setRecordFolder(Boolean isRecordFolder)
|
|
||||||
{
|
|
||||||
this.isRecordFolder = isRecordFolder;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the isFile
|
|
||||||
*/
|
|
||||||
public Boolean isFile()
|
|
||||||
{
|
|
||||||
return this.isFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param isFile the isFile to set
|
|
||||||
*/
|
|
||||||
public void setFile(Boolean isFile)
|
|
||||||
{
|
|
||||||
this.isFile = isFile;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the hasRetentionSchedule
|
|
||||||
*/
|
|
||||||
public Boolean hasRetentionSchedule()
|
|
||||||
{
|
|
||||||
return this.hasRetentionSchedule;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param hasRetentionSchedule the hasRetentionSchedule to set
|
|
||||||
*/
|
|
||||||
public void setHasRetentionSchedule(Boolean hasRetentionSchedule)
|
|
||||||
{
|
|
||||||
this.hasRetentionSchedule = hasRetentionSchedule;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the properties
|
|
||||||
*/
|
|
||||||
public FilePlanComponentProperties getProperties()
|
|
||||||
{
|
|
||||||
return properties;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param properties the properties to set
|
|
||||||
*/
|
|
||||||
public void setProperties(FilePlanComponentProperties properties)
|
|
||||||
{
|
|
||||||
this.properties = properties;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the aspectNames
|
|
||||||
*/
|
|
||||||
public List<String> getAspectNames()
|
|
||||||
{
|
|
||||||
return this.aspectNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param aspectNames the aspectNames to set
|
|
||||||
*/
|
|
||||||
public void setAspectNames(List<String> aspectNames)
|
|
||||||
{
|
|
||||||
this.aspectNames = aspectNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the createdByUser
|
|
||||||
*/
|
|
||||||
public FilePlanComponentUserInfo getCreatedByUser()
|
|
||||||
{
|
|
||||||
return this.createdByUser;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param createdByUser the createdByUser to set
|
|
||||||
*/
|
|
||||||
public void setCreatedByUser(FilePlanComponentUserInfo createdByUser)
|
|
||||||
{
|
|
||||||
this.createdByUser = createdByUser;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the allowableOperations
|
|
||||||
*/
|
|
||||||
public List<String> getAllowableOperations()
|
|
||||||
{
|
|
||||||
return this.allowableOperations;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the path
|
|
||||||
*/
|
|
||||||
public FilePlanComponentPath getPath()
|
|
||||||
{
|
|
||||||
return this.path;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param path the path to set
|
|
||||||
*/
|
|
||||||
public void setPath(FilePlanComponentPath path)
|
|
||||||
{
|
|
||||||
this.path = path;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param modifiedAt the modifiedAt to set
|
|
||||||
*/
|
|
||||||
public void setModifiedAt(String modifiedAt)
|
|
||||||
{
|
|
||||||
this.modifiedAt = modifiedAt;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param createdAt the createdAt to set
|
|
||||||
*/
|
|
||||||
public void setCreatedAt(String createdAt)
|
|
||||||
{
|
|
||||||
this.createdAt = createdAt;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param modifiedByUser the modifiedByUser to set
|
|
||||||
*/
|
|
||||||
public void setModifiedByUser(FilePlanComponentUserInfo modifiedByUser)
|
|
||||||
{
|
|
||||||
this.modifiedByUser = modifiedByUser;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the modifiedAt
|
|
||||||
*/
|
|
||||||
public String getModifiedAt()
|
|
||||||
{
|
|
||||||
return this.modifiedAt;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the createdAt
|
|
||||||
*/
|
|
||||||
public String getCreatedAt()
|
|
||||||
{
|
|
||||||
return this.createdAt;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the modifiedByUser
|
|
||||||
*/
|
|
||||||
public FilePlanComponentUserInfo getModifiedByUser()
|
|
||||||
{
|
|
||||||
return this.modifiedByUser;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the isClosed
|
|
||||||
*/
|
|
||||||
public Boolean isClosed()
|
|
||||||
{
|
|
||||||
return this.isClosed;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param closed the isClosed to set
|
|
||||||
*/
|
|
||||||
public void setClosed(Boolean closed)
|
|
||||||
{
|
|
||||||
this.isClosed = closed;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the isCompleted
|
|
||||||
*/
|
|
||||||
public Boolean isCompleted()
|
|
||||||
{
|
|
||||||
return this.isCompleted;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param completed the isCompleted to set
|
|
||||||
*/
|
|
||||||
public void setCompleted(Boolean completed)
|
|
||||||
{
|
|
||||||
this.isCompleted = completed;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -37,77 +37,14 @@ public class FilePlanComponentContent
|
|||||||
{
|
{
|
||||||
@JsonProperty (required = true)
|
@JsonProperty (required = true)
|
||||||
private String encoding;
|
private String encoding;
|
||||||
|
|
||||||
@JsonProperty (required = true)
|
@JsonProperty (required = true)
|
||||||
private String mimeType;
|
private String mimeType;
|
||||||
|
|
||||||
@JsonProperty (required = true)
|
@JsonProperty (required = true)
|
||||||
private String mimeTypeName;
|
private String mimeTypeName;
|
||||||
|
|
||||||
@JsonProperty (required = true)
|
@JsonProperty (required = true)
|
||||||
private Integer sizeInBytes;
|
private Integer sizeInBytes;
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the encoding
|
|
||||||
*/
|
|
||||||
public String getEncoding()
|
|
||||||
{
|
|
||||||
return this.encoding;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param encoding the encoding to set
|
|
||||||
*/
|
|
||||||
public void setEncoding(String encoding)
|
|
||||||
{
|
|
||||||
this.encoding = encoding;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the mimeType
|
|
||||||
*/
|
|
||||||
public String getMimeType()
|
|
||||||
{
|
|
||||||
return this.mimeType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param mimeType the mimeType to set
|
|
||||||
*/
|
|
||||||
public void setMimeType(String mimeType)
|
|
||||||
{
|
|
||||||
this.mimeType = mimeType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the mimeTypeName
|
|
||||||
*/
|
|
||||||
public String getMimeTypeName()
|
|
||||||
{
|
|
||||||
return this.mimeTypeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param mimeTypeName the mimeTypeName to set
|
|
||||||
*/
|
|
||||||
public void setMimeTypeName(String mimeTypeName)
|
|
||||||
{
|
|
||||||
this.mimeTypeName = mimeTypeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the sizeInBytes
|
|
||||||
*/
|
|
||||||
public Integer getSizeInBytes()
|
|
||||||
{
|
|
||||||
return this.sizeInBytes;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param sizeInBytes the sizeInBytes to set
|
|
||||||
*/
|
|
||||||
public void setSizeInBytes(Integer sizeInBytes)
|
|
||||||
{
|
|
||||||
this.sizeInBytes = sizeInBytes;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -30,6 +30,10 @@ import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanCo
|
|||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
import org.alfresco.rest.core.RestModels;
|
import org.alfresco.rest.core.RestModels;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,13 +42,13 @@ import org.alfresco.rest.core.RestModels;
|
|||||||
* @author Tuna Aksoy
|
* @author Tuna Aksoy
|
||||||
* @since 2.6
|
* @since 2.6
|
||||||
*/
|
*/
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class FilePlanComponentEntry extends RestModels<FilePlanComponent, FilePlanComponentEntry>
|
public class FilePlanComponentEntry extends RestModels<FilePlanComponent, FilePlanComponentEntry>
|
||||||
{
|
{
|
||||||
@JsonProperty(ENTRY)
|
@JsonProperty(ENTRY)
|
||||||
FilePlanComponent filePlanComponent;
|
FilePlanComponent filePlanComponent;
|
||||||
|
|
||||||
public FilePlanComponent getFilePlanComponent()
|
|
||||||
{
|
|
||||||
return filePlanComponent;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -26,46 +26,24 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.rest.rm.community.model.fileplancomponents;
|
package org.alfresco.rest.rm.community.model.fileplancomponents;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POJO for id/name pair
|
* POJO for id/name pair
|
||||||
*
|
*
|
||||||
* @author Kristijan Conkas
|
* @author Kristijan Conkas
|
||||||
* @since 2.6
|
* @since 2.6
|
||||||
*/
|
*/
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class FilePlanComponentIdNamePair
|
public class FilePlanComponentIdNamePair
|
||||||
{
|
{
|
||||||
public String id;
|
public String id;
|
||||||
public String name;
|
public String name;
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the id
|
|
||||||
*/
|
|
||||||
public String getId()
|
|
||||||
{
|
|
||||||
return this.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param id the id to set
|
|
||||||
*/
|
|
||||||
public void setId(String id)
|
|
||||||
{
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the name
|
|
||||||
*/
|
|
||||||
public String getName()
|
|
||||||
{
|
|
||||||
return this.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param name the name to set
|
|
||||||
*/
|
|
||||||
public void setName(String name)
|
|
||||||
{
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -30,12 +30,21 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POJO for FilePlanComponent path parameter
|
* POJO for FilePlanComponent path parameter
|
||||||
* <br>
|
* <br>
|
||||||
* @author Kristijan Conkas
|
* @author Kristijan Conkas
|
||||||
* @since 2.6
|
* @since 2.6
|
||||||
*/
|
*/
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public class FilePlanComponentPath
|
public class FilePlanComponentPath
|
||||||
{
|
{
|
||||||
@@ -43,51 +52,4 @@ public class FilePlanComponentPath
|
|||||||
private Boolean isComplete;
|
private Boolean isComplete;
|
||||||
private List<FilePlanComponentIdNamePair> elements;
|
private List<FilePlanComponentIdNamePair> elements;
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the name
|
|
||||||
*/
|
|
||||||
public String getName()
|
|
||||||
{
|
|
||||||
return this.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param name the name to set
|
|
||||||
*/
|
|
||||||
public void setName(String name)
|
|
||||||
{
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the isComplete
|
|
||||||
*/
|
|
||||||
public Boolean isComplete()
|
|
||||||
{
|
|
||||||
return this.isComplete;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param isComplete the isComplete to set
|
|
||||||
*/
|
|
||||||
public void setComplete(Boolean isComplete)
|
|
||||||
{
|
|
||||||
this.isComplete = isComplete;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the elements
|
|
||||||
*/
|
|
||||||
public List<FilePlanComponentIdNamePair> getElements()
|
|
||||||
{
|
|
||||||
return this.elements;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param elements the elements to set
|
|
||||||
*/
|
|
||||||
public void setElements(List<FilePlanComponentIdNamePair> elements)
|
|
||||||
{
|
|
||||||
this.elements = elements;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -48,6 +48,11 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|||||||
|
|
||||||
import org.alfresco.rest.rm.community.util.ReviewPeriodSerializer;
|
import org.alfresco.rest.rm.community.util.ReviewPeriodSerializer;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POJO for file plan component properties
|
* POJO for file plan component properties
|
||||||
*
|
*
|
||||||
@@ -56,6 +61,10 @@ import org.alfresco.rest.rm.community.util.ReviewPeriodSerializer;
|
|||||||
*/
|
*/
|
||||||
//FIXME: Once the fields have been added the JsonIgnoreProperties annotation should be removed
|
//FIXME: Once the fields have been added the JsonIgnoreProperties annotation should be removed
|
||||||
@JsonIgnoreProperties (ignoreUnknown = true)
|
@JsonIgnoreProperties (ignoreUnknown = true)
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class FilePlanComponentProperties
|
public class FilePlanComponentProperties
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -80,7 +89,7 @@ public class FilePlanComponentProperties
|
|||||||
|
|
||||||
@JsonProperty(PROPERTIES_LOCATION)
|
@JsonProperty(PROPERTIES_LOCATION)
|
||||||
private String location;
|
private String location;
|
||||||
|
|
||||||
@JsonProperty(value = PROPERTIES_IS_CLOSED, required = false)
|
@JsonProperty(value = PROPERTIES_IS_CLOSED, required = false)
|
||||||
private Boolean isClosed;
|
private Boolean isClosed;
|
||||||
|
|
||||||
@@ -100,227 +109,4 @@ public class FilePlanComponentProperties
|
|||||||
private Integer physicalSize;
|
private Integer physicalSize;
|
||||||
|
|
||||||
|
|
||||||
public FilePlanComponentProperties(String title, String description)
|
|
||||||
{
|
|
||||||
this.title = title;
|
|
||||||
this.description = description;
|
|
||||||
}
|
|
||||||
|
|
||||||
public FilePlanComponentProperties(String title)
|
|
||||||
{
|
|
||||||
this.title = title;
|
|
||||||
}
|
|
||||||
|
|
||||||
public FilePlanComponentProperties()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the vitalRecord
|
|
||||||
*/
|
|
||||||
public Boolean isVitalRecord()
|
|
||||||
{
|
|
||||||
return this.vitalRecord;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param vitalRecord the vitalRecord to set
|
|
||||||
*/
|
|
||||||
public void setVitalRecord(Boolean vitalRecord)
|
|
||||||
{
|
|
||||||
this.vitalRecord = vitalRecord;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the title
|
|
||||||
*/
|
|
||||||
public String getTitle()
|
|
||||||
{
|
|
||||||
return this.title;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param title the title to set
|
|
||||||
*/
|
|
||||||
public void setTitle(String title)
|
|
||||||
{
|
|
||||||
this.title = title;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the holdReason
|
|
||||||
*/
|
|
||||||
public String getHoldReason()
|
|
||||||
{
|
|
||||||
return this.holdReason;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param holdReason the holdReason to set
|
|
||||||
*/
|
|
||||||
public void setHoldReason(String holdReason)
|
|
||||||
{
|
|
||||||
this.holdReason = holdReason;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param description the description to set
|
|
||||||
*/
|
|
||||||
public void setDescription(String description)
|
|
||||||
{
|
|
||||||
this.description = description;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the description
|
|
||||||
*/
|
|
||||||
public String getDescription()
|
|
||||||
{
|
|
||||||
return this.description;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the supplementalMarkingList
|
|
||||||
*/
|
|
||||||
public List<String> getSupplementalMarkingList()
|
|
||||||
{
|
|
||||||
return this.supplementalMarkingList;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param supplementalMarkingList the supplementalMarkingList to set
|
|
||||||
*/
|
|
||||||
public void setSupplementalMarkingList(List<String> supplementalMarkingList)
|
|
||||||
{
|
|
||||||
this.supplementalMarkingList = supplementalMarkingList;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the reviewPeriod
|
|
||||||
*/
|
|
||||||
public ReviewPeriod getReviewPeriod()
|
|
||||||
{
|
|
||||||
return reviewPeriod;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param reviewPeriod the reviewPeriod to set
|
|
||||||
*/
|
|
||||||
public void setReviewPeriod(ReviewPeriod reviewPeriod)
|
|
||||||
{
|
|
||||||
this.reviewPeriod = reviewPeriod;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the location
|
|
||||||
*/
|
|
||||||
public String getLocation()
|
|
||||||
{
|
|
||||||
return location;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param location the location to set
|
|
||||||
*/
|
|
||||||
public void setLocation(String location)
|
|
||||||
{
|
|
||||||
this.location = location;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the box
|
|
||||||
*/
|
|
||||||
public String getBox()
|
|
||||||
{
|
|
||||||
return this.box;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param box the box to set
|
|
||||||
*/
|
|
||||||
public void setBox(String box)
|
|
||||||
{
|
|
||||||
this.box = box;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the file
|
|
||||||
*/
|
|
||||||
public String getFile()
|
|
||||||
{
|
|
||||||
return this.file;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param file the file to set
|
|
||||||
*/
|
|
||||||
public void setFile(String file)
|
|
||||||
{
|
|
||||||
this.file = file;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the shelf
|
|
||||||
*/
|
|
||||||
public String getShelf()
|
|
||||||
{
|
|
||||||
return this.shelf;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param shelf the shelf to set
|
|
||||||
*/
|
|
||||||
public void setShelf(String shelf)
|
|
||||||
{
|
|
||||||
this.shelf = shelf;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the numberOfCopies
|
|
||||||
*/
|
|
||||||
public Integer getNumberOfCopies()
|
|
||||||
{
|
|
||||||
return this.numberOfCopies;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param numberOfCopies the numberOfCopies to set
|
|
||||||
*/
|
|
||||||
public void setNumberOfCopies(Integer numberOfCopies)
|
|
||||||
{
|
|
||||||
this.numberOfCopies = numberOfCopies;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the physicalSize
|
|
||||||
*/
|
|
||||||
public Integer getPhysicalSize()
|
|
||||||
{
|
|
||||||
return this.physicalSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param physicalSize the physicalSize to set
|
|
||||||
*/
|
|
||||||
public void setPhysicalSize(Integer physicalSize)
|
|
||||||
{
|
|
||||||
this.physicalSize = physicalSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the isClosed
|
|
||||||
*/
|
|
||||||
public Boolean getIsClosed()
|
|
||||||
{
|
|
||||||
return this.isClosed;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param isClosed the isClosed to set
|
|
||||||
*/
|
|
||||||
public void setIsClosed(Boolean isClosed)
|
|
||||||
{
|
|
||||||
this.isClosed = isClosed;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -26,46 +26,24 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.rest.rm.community.model.fileplancomponents;
|
package org.alfresco.rest.rm.community.model.fileplancomponents;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POJO for file plan component created by object
|
* POJO for file plan component created by object
|
||||||
*
|
*
|
||||||
* @author Kristijan Conkas
|
* @author Kristijan Conkas
|
||||||
* @since 2.6
|
* @since 2.6
|
||||||
*/
|
*/
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class FilePlanComponentUserInfo
|
public class FilePlanComponentUserInfo
|
||||||
{
|
{
|
||||||
private String id;
|
private String id;
|
||||||
private String displayName;
|
private String displayName;
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the id
|
|
||||||
*/
|
|
||||||
public String getId()
|
|
||||||
{
|
|
||||||
return this.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param id the id to set
|
|
||||||
*/
|
|
||||||
public void setId(String id)
|
|
||||||
{
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the displayName
|
|
||||||
*/
|
|
||||||
public String getDisplayName()
|
|
||||||
{
|
|
||||||
return this.displayName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param displayName the displayName to set
|
|
||||||
*/
|
|
||||||
public void setDisplayName(String displayName)
|
|
||||||
{
|
|
||||||
this.displayName = displayName;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -26,66 +26,23 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.rest.rm.community.model.fileplancomponents;
|
package org.alfresco.rest.rm.community.model.fileplancomponents;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POJO for the review period
|
* POJO for the review period
|
||||||
*
|
*
|
||||||
* @author Rodica Sutu
|
* @author Rodica Sutu
|
||||||
* @since 2.6
|
* @since 2.6
|
||||||
*/
|
*/
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class ReviewPeriod
|
public class ReviewPeriod
|
||||||
{
|
{
|
||||||
private String periodType;
|
private String periodType;
|
||||||
private String expression;
|
private String expression;
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper constructor with
|
|
||||||
*
|
|
||||||
* @param periodType
|
|
||||||
* @param expression
|
|
||||||
*/
|
|
||||||
public ReviewPeriod(String periodType, String expression)
|
|
||||||
{
|
|
||||||
this.periodType = periodType;
|
|
||||||
this.expression = expression;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper constructor
|
|
||||||
*/
|
|
||||||
public ReviewPeriod()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the periodType
|
|
||||||
*/
|
|
||||||
public String getPeriodType()
|
|
||||||
{
|
|
||||||
return this.periodType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param periodType the periodType to set
|
|
||||||
*/
|
|
||||||
public void setPeriodType(String periodType)
|
|
||||||
{
|
|
||||||
this.periodType = periodType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the expression
|
|
||||||
*/
|
|
||||||
public String getExpression()
|
|
||||||
{
|
|
||||||
return this.expression;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param expression the expression to set
|
|
||||||
*/
|
|
||||||
public void setExpression(String expression)
|
|
||||||
{
|
|
||||||
this.expression = expression;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -30,6 +30,10 @@ import static org.alfresco.rest.rm.community.model.site.RMSiteFields.COMPLIANCE;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
import org.alfresco.rest.model.RestSiteModel;
|
import org.alfresco.rest.model.RestSiteModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,59 +42,13 @@ import org.alfresco.rest.model.RestSiteModel;
|
|||||||
* @author Rodica Sutu
|
* @author Rodica Sutu
|
||||||
* @since 2.6
|
* @since 2.6
|
||||||
*/
|
*/
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class RMSite extends RestSiteModel
|
public class RMSite extends RestSiteModel
|
||||||
{
|
{
|
||||||
@JsonProperty (value = COMPLIANCE,required = true)
|
@JsonProperty (value = COMPLIANCE,required = true)
|
||||||
private RMSiteCompliance compliance;
|
private RMSiteCompliance compliance;
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper constructor to create RM Site object using
|
|
||||||
*
|
|
||||||
* @param title
|
|
||||||
* @param description
|
|
||||||
* @param compliance
|
|
||||||
*/
|
|
||||||
public RMSite(String title, String description, RMSiteCompliance compliance)
|
|
||||||
{
|
|
||||||
this.title=title;
|
|
||||||
this.description=description;
|
|
||||||
this.compliance=compliance;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper constructor for creating the RM Site
|
|
||||||
*/
|
|
||||||
public RMSite() { }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper constructor to create RM Site object using
|
|
||||||
*
|
|
||||||
* @param compliance RM Site Compliance
|
|
||||||
*/
|
|
||||||
public RMSite(RMSiteCompliance compliance)
|
|
||||||
{
|
|
||||||
super();
|
|
||||||
this.compliance = compliance;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper method to set RM site compliance
|
|
||||||
*
|
|
||||||
* @param compliance {@link RMSiteCompliance} the compliance to set
|
|
||||||
*/
|
|
||||||
public void setCompliance(RMSiteCompliance compliance)
|
|
||||||
{
|
|
||||||
this.compliance = compliance;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper method to get RM site compliance
|
|
||||||
*
|
|
||||||
* @return compliance the RM Site compliance to get
|
|
||||||
*/
|
|
||||||
public RMSiteCompliance getCompliance()
|
|
||||||
{
|
|
||||||
return compliance;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -113,7 +113,7 @@ public class BaseRestTest extends RestTest
|
|||||||
{ createUnfiledRecordsFolder(UNFILED_RECORDS_CONTAINER_ALIAS.toString(), "Unfiled Folder " + getRandomAlphanumeric()) }
|
{ createUnfiledRecordsFolder(UNFILED_RECORDS_CONTAINER_ALIAS.toString(), "Unfiled Folder " + getRandomAlphanumeric()) }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.alfresco.rest.RestTest#checkServerHealth()
|
* @see org.alfresco.rest.RestTest#checkServerHealth()
|
||||||
*/
|
*/
|
||||||
@@ -141,7 +141,9 @@ public class BaseRestTest extends RestTest
|
|||||||
rmSiteAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
rmSiteAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||||
|
|
||||||
// Create the RM site
|
// Create the RM site
|
||||||
RMSite rmSite = new RMSite(RM_TITLE, RM_DESCRIPTION, STANDARD);
|
RMSite rmSite = RMSite.builder().compliance(STANDARD).build();
|
||||||
|
rmSite.setTitle(RM_TITLE);
|
||||||
|
rmSite.setDescription(RM_DESCRIPTION);
|
||||||
rmSiteAPI.createRMSite(rmSite);
|
rmSiteAPI.createRMSite(rmSite);
|
||||||
|
|
||||||
// Verify the status code
|
// Verify the status code
|
||||||
@@ -202,7 +204,13 @@ public class BaseRestTest extends RestTest
|
|||||||
{
|
{
|
||||||
RestWrapper restWrapper = filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
RestWrapper restWrapper = filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||||
|
|
||||||
FilePlanComponent filePlanComponent = new FilePlanComponent(componentName, componentType.toString(),new FilePlanComponentProperties(componentTitle));
|
FilePlanComponent filePlanComponent = FilePlanComponent.builder()
|
||||||
|
.name(componentName)
|
||||||
|
.nodeType(componentType.toString())
|
||||||
|
.properties(FilePlanComponentProperties.builder()
|
||||||
|
.title(componentTitle)
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
FilePlanComponent fpc = filePlanComponentAPI.createFilePlanComponent(filePlanComponent, parentComponentId);
|
FilePlanComponent fpc = filePlanComponentAPI.createFilePlanComponent(filePlanComponent, parentComponentId);
|
||||||
restWrapper.assertStatusCodeIs(CREATED);
|
restWrapper.assertStatusCodeIs(CREATED);
|
||||||
@@ -211,7 +219,7 @@ public class BaseRestTest extends RestTest
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper method to close folder
|
* Helper method to close folder
|
||||||
* @param folderToClose
|
* @param folderId
|
||||||
* @return
|
* @return
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
|
@@ -41,7 +41,6 @@ import static org.testng.Assert.assertTrue;
|
|||||||
|
|
||||||
import org.alfresco.rest.rm.community.base.BaseRestTest;
|
import org.alfresco.rest.rm.community.base.BaseRestTest;
|
||||||
import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponent;
|
import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponent;
|
||||||
import org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentProperties;
|
|
||||||
import org.alfresco.rest.rm.community.requests.FilePlanComponentAPI;
|
import org.alfresco.rest.rm.community.requests.FilePlanComponentAPI;
|
||||||
import org.alfresco.utility.data.DataUser;
|
import org.alfresco.utility.data.DataUser;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -64,16 +63,16 @@ public class ElectronicRecordTests extends BaseRestTest
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private DataUser dataUser;
|
private DataUser dataUser;
|
||||||
|
|
||||||
/** image resource file to be used for records body */
|
/** image resource file to be used for records body */
|
||||||
private static final String IMAGE_FILE = "money.JPG";
|
private static final String IMAGE_FILE = "money.JPG";
|
||||||
|
|
||||||
/** Valid root containers where electronic records can be created */
|
/** Valid root containers where electronic records can be created */
|
||||||
@DataProvider(name = "invalidParentContainers")
|
@DataProvider(name = "invalidParentContainers")
|
||||||
public Object[][] invalidContainers() throws Exception {
|
public Object[][] invalidContainers() throws Exception {
|
||||||
return new Object[][] {
|
return new Object[][] {
|
||||||
// record category
|
// record category
|
||||||
{ getFilePlanComponentAsUser(dataUser.getAdminUser(),
|
{ getFilePlanComponentAsUser(dataUser.getAdminUser(),
|
||||||
createCategoryFolderInFilePlan(dataUser.getAdminUser(), FILE_PLAN_ALIAS.toString()).getParentId()) },
|
createCategoryFolderInFilePlan(dataUser.getAdminUser(), FILE_PLAN_ALIAS.toString()).getParentId()) },
|
||||||
// file plan root
|
// file plan root
|
||||||
{ getFilePlanComponentAsUser(dataUser.getAdminUser(), FILE_PLAN_ALIAS.toString()) },
|
{ getFilePlanComponentAsUser(dataUser.getAdminUser(), FILE_PLAN_ALIAS.toString()) },
|
||||||
@@ -83,7 +82,7 @@ public class ElectronicRecordTests extends BaseRestTest
|
|||||||
{ getFilePlanComponentAsUser(dataUser.getAdminUser(), HOLDS_ALIAS.toString()) },
|
{ getFilePlanComponentAsUser(dataUser.getAdminUser(), HOLDS_ALIAS.toString()) },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* Given a parent container that is NOT a record folder or an unfiled record folder
|
* Given a parent container that is NOT a record folder or an unfiled record folder
|
||||||
@@ -103,10 +102,13 @@ public class ElectronicRecordTests extends BaseRestTest
|
|||||||
{
|
{
|
||||||
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||||
|
|
||||||
FilePlanComponent record = new FilePlanComponent("Record " + getRandomAlphanumeric(), CONTENT_TYPE.toString(),
|
// Build object the filePlan
|
||||||
new FilePlanComponentProperties());
|
FilePlanComponent record = FilePlanComponent.builder()
|
||||||
|
.name("Record " + getRandomAlphanumeric())
|
||||||
|
.nodeType(CONTENT_TYPE.toString())
|
||||||
|
.build();
|
||||||
filePlanComponentAPI.createElectronicRecord(record, IMAGE_FILE, container.getId());
|
filePlanComponentAPI.createElectronicRecord(record, IMAGE_FILE, container.getId());
|
||||||
|
|
||||||
// verify the create request status code
|
// verify the create request status code
|
||||||
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(UNPROCESSABLE_ENTITY);
|
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(UNPROCESSABLE_ENTITY);
|
||||||
}
|
}
|
||||||
@@ -114,7 +116,7 @@ public class ElectronicRecordTests extends BaseRestTest
|
|||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* Given a parent container that is a record folder
|
* Given a parent container that is a record folder
|
||||||
* And the record folder is closed
|
* And the record folder is closed
|
||||||
* When I try to create an electronic record within the parent container
|
* When I try to create an electronic record within the parent container
|
||||||
* Then nothing happens
|
* Then nothing happens
|
||||||
* And an error is reported
|
* And an error is reported
|
||||||
@@ -126,22 +128,24 @@ public class ElectronicRecordTests extends BaseRestTest
|
|||||||
{
|
{
|
||||||
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||||
FilePlanComponent recordFolder = createCategoryFolderInFilePlan(dataUser.getAdminUser(), FILE_PLAN_ALIAS.toString());
|
FilePlanComponent recordFolder = createCategoryFolderInFilePlan(dataUser.getAdminUser(), FILE_PLAN_ALIAS.toString());
|
||||||
|
|
||||||
// the folder should be open
|
// the folder should be open
|
||||||
assertFalse(recordFolder.getProperties().getIsClosed());
|
assertFalse(recordFolder.getProperties().getIsClosed());
|
||||||
|
|
||||||
// close the folder
|
// close the folder
|
||||||
closeFolder(recordFolder.getId());
|
closeFolder(recordFolder.getId());
|
||||||
|
|
||||||
// try to create it, this should fail
|
// try to create it, this should fail
|
||||||
FilePlanComponent record = new FilePlanComponent("Record " + getRandomAlphanumeric(), CONTENT_TYPE.toString(),
|
FilePlanComponent record = FilePlanComponent.builder()
|
||||||
new FilePlanComponentProperties());
|
.name("Record " + getRandomAlphanumeric())
|
||||||
|
.nodeType(CONTENT_TYPE.toString())
|
||||||
|
.build();
|
||||||
filePlanComponentAPI.createElectronicRecord(record, IMAGE_FILE, recordFolder.getId());
|
filePlanComponentAPI.createElectronicRecord(record, IMAGE_FILE, recordFolder.getId());
|
||||||
|
|
||||||
// verify the status code
|
// verify the status code
|
||||||
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(UNPROCESSABLE_ENTITY);
|
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(UNPROCESSABLE_ENTITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* Given a parent container that is a record folder
|
* Given a parent container that is a record folder
|
||||||
@@ -164,13 +168,13 @@ public class ElectronicRecordTests extends BaseRestTest
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
(
|
(
|
||||||
dataProvider = "validRootContainers",
|
dataProvider = "validRootContainers",
|
||||||
description = "Electronic record can only be created if all mandatory properties are given"
|
description = "Electronic record can only be created if all mandatory properties are given"
|
||||||
)
|
)
|
||||||
public void canCreateElectronicRecordOnlyWithMandatoryProperties(FilePlanComponent container) throws Exception
|
public void canCreateElectronicRecordOnlyWithMandatoryProperties(FilePlanComponent container) throws Exception
|
||||||
{
|
{
|
||||||
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||||
|
|
||||||
logger.info("Root container:\n" + toJson(container));
|
logger.info("Root container:\n" + toJson(container));
|
||||||
if (container.getNodeType().equals(RECORD_FOLDER_TYPE.toString()))
|
if (container.getNodeType().equals(RECORD_FOLDER_TYPE.toString()))
|
||||||
{
|
{
|
||||||
@@ -179,17 +183,17 @@ public class ElectronicRecordTests extends BaseRestTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
// component without name
|
// component without name
|
||||||
FilePlanComponent record = new FilePlanComponent();
|
FilePlanComponent record = FilePlanComponent.builder()
|
||||||
record.setNodeType(CONTENT_TYPE.toString());
|
.nodeType(CONTENT_TYPE.toString())
|
||||||
record.setProperties(new FilePlanComponentProperties());
|
.build();
|
||||||
|
|
||||||
// try to create it
|
// try to create it
|
||||||
filePlanComponentAPI.createFilePlanComponent(record, container.getId());
|
filePlanComponentAPI.createFilePlanComponent(record, container.getId());
|
||||||
|
|
||||||
// verify the status code is BAD_REQUEST
|
// verify the status code is BAD_REQUEST
|
||||||
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(BAD_REQUEST);
|
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(BAD_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* Given a parent container that is a record folder
|
* Given a parent container that is a record folder
|
||||||
@@ -216,24 +220,24 @@ public class ElectronicRecordTests extends BaseRestTest
|
|||||||
{
|
{
|
||||||
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||||
|
|
||||||
FilePlanComponent record = new FilePlanComponent();
|
FilePlanComponent record = FilePlanComponent.builder()
|
||||||
record.setName("Record " + getRandomAlphanumeric());
|
.name("Record " + getRandomAlphanumeric())
|
||||||
record.setNodeType(CONTENT_TYPE.toString());
|
.nodeType(CONTENT_TYPE.toString())
|
||||||
|
.build();
|
||||||
String newRecordId = filePlanComponentAPI.createElectronicRecord(record, IMAGE_FILE, container.getId()).getId();
|
String newRecordId = filePlanComponentAPI.createElectronicRecord(record, IMAGE_FILE, container.getId()).getId();
|
||||||
|
|
||||||
// verify the create request status code
|
// verify the create request status code
|
||||||
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(CREATED);
|
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(CREATED);
|
||||||
|
|
||||||
// get newly created electonic record and verify its properties
|
// get newly created electonic record and verify its properties
|
||||||
FilePlanComponent electronicRecord = filePlanComponentAPI.getFilePlanComponent(newRecordId);
|
FilePlanComponent electronicRecord = filePlanComponentAPI.getFilePlanComponent(newRecordId);
|
||||||
// created record will have record identifier inserted in its name but will be prefixed with
|
// created record will have record identifier inserted in its name but will be prefixed with
|
||||||
// the name it was created as
|
// the name it was created as
|
||||||
assertTrue(electronicRecord.getName().startsWith(record.getName()));
|
assertTrue(electronicRecord.getName().startsWith(record.getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This test verified that in the test client implementation if record name isn't specified it
|
* This test verified that in the test client implementation if record name isn't specified it
|
||||||
* defaults to filed file name.
|
* defaults to filed file name.
|
||||||
* @param container valid record container
|
* @param container valid record container
|
||||||
* @throws Exception if record creation failed
|
* @throws Exception if record creation failed
|
||||||
@@ -248,14 +252,15 @@ public class ElectronicRecordTests extends BaseRestTest
|
|||||||
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||||
|
|
||||||
// record object without name set
|
// record object without name set
|
||||||
FilePlanComponent record = new FilePlanComponent();
|
FilePlanComponent record = FilePlanComponent.builder()
|
||||||
record.setNodeType(CONTENT_TYPE.toString());
|
.nodeType(CONTENT_TYPE.toString())
|
||||||
|
.build();
|
||||||
|
|
||||||
String newRecordId = filePlanComponentAPI.createElectronicRecord(record, IMAGE_FILE, container.getId()).getId();
|
String newRecordId = filePlanComponentAPI.createElectronicRecord(record, IMAGE_FILE, container.getId()).getId();
|
||||||
|
|
||||||
// verify the create request status code
|
// verify the create request status code
|
||||||
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(CREATED);
|
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(CREATED);
|
||||||
|
|
||||||
// get newly created electonic record and verify its properties
|
// get newly created electonic record and verify its properties
|
||||||
FilePlanComponent electronicRecord = filePlanComponentAPI.getFilePlanComponent(newRecordId);
|
FilePlanComponent electronicRecord = filePlanComponentAPI.getFilePlanComponent(newRecordId);
|
||||||
// record will have record identifier inserted in its name but will for sure start with file name
|
// record will have record identifier inserted in its name but will for sure start with file name
|
||||||
|
@@ -199,9 +199,12 @@ public class FilePlanTests extends BaseRestTest
|
|||||||
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||||
|
|
||||||
// Build object for updating the filePlan
|
// Build object for updating the filePlan
|
||||||
FilePlanComponent filePlanComponent = new FilePlanComponent();
|
FilePlanComponent filePlanComponent = FilePlanComponent.builder()
|
||||||
FilePlanComponentProperties filePlanComponentProperties=new FilePlanComponentProperties(FILE_PLAN_TITLE, FILE_PLAN_DESCRIPTION);
|
.properties(FilePlanComponentProperties.builder()
|
||||||
filePlanComponent.setProperties(filePlanComponentProperties);
|
.title(FILE_PLAN_TITLE)
|
||||||
|
.description(FILE_PLAN_DESCRIPTION)
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
// Update the record category
|
// Update the record category
|
||||||
FilePlanComponent renamedFilePlanComponent = filePlanComponentAPI.updateFilePlanComponent(filePlanComponent,FILE_PLAN_ALIAS.toString());
|
FilePlanComponent renamedFilePlanComponent = filePlanComponentAPI.updateFilePlanComponent(filePlanComponent,FILE_PLAN_ALIAS.toString());
|
||||||
@@ -301,7 +304,12 @@ public class FilePlanTests extends BaseRestTest
|
|||||||
String name = filePlanAlias + getRandomAlphanumeric();
|
String name = filePlanAlias + getRandomAlphanumeric();
|
||||||
|
|
||||||
// Build the file plan root properties
|
// Build the file plan root properties
|
||||||
FilePlanComponent filePlanComponent = new FilePlanComponent(name,rmType.toString(),new FilePlanComponentProperties());
|
FilePlanComponent filePlanComponent = FilePlanComponent.builder()
|
||||||
|
.name(name)
|
||||||
|
.nodeType(rmType.toString())
|
||||||
|
.properties(FilePlanComponentProperties.builder()
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
// Authenticate with admin user
|
// Authenticate with admin user
|
||||||
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||||
|
@@ -70,10 +70,10 @@ public class NonElectronicRecordTests extends BaseRestTest
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private DataUser dataUser;
|
private DataUser dataUser;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RMSiteAPI rmSiteAPI;
|
private RMSiteAPI rmSiteAPI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* Given a parent container that is NOT a record folder or an unfiled record folder
|
* Given a parent container that is NOT a record folder or an unfiled record folder
|
||||||
@@ -87,24 +87,25 @@ public class NonElectronicRecordTests extends BaseRestTest
|
|||||||
public void cantCreateForInvalidParentIds() throws Exception
|
public void cantCreateForInvalidParentIds() throws Exception
|
||||||
{
|
{
|
||||||
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||||
|
|
||||||
// non-electronic record object to be used for create tests
|
// non-electronic record object to be used for create tests
|
||||||
FilePlanComponent nonElectronicRecord = new FilePlanComponent(
|
FilePlanComponent nonElectronicRecord = FilePlanComponent.builder()
|
||||||
"Record " + getRandomAlphanumeric(),
|
.name("Record " + getRandomAlphanumeric())
|
||||||
NON_ELECTRONIC_RECORD_TYPE.toString(),
|
.nodeType(NON_ELECTRONIC_RECORD_TYPE.toString())
|
||||||
new FilePlanComponentProperties());
|
.build();
|
||||||
|
|
||||||
// create record category, non-electronic records can't be its children
|
// create record category, non-electronic records can't be its children
|
||||||
FilePlanComponent recordCategory = filePlanComponentAPI.createFilePlanComponent(
|
FilePlanComponent recordCategoryModel = FilePlanComponent.builder()
|
||||||
new FilePlanComponent("Category " + getRandomAlphanumeric(),
|
.name("Category " + getRandomAlphanumeric())
|
||||||
RECORD_CATEGORY_TYPE.toString(),
|
.nodeType(RECORD_CATEGORY_TYPE.toString())
|
||||||
new FilePlanComponentProperties()),
|
.build();
|
||||||
FILE_PLAN_ALIAS.toString());
|
|
||||||
|
FilePlanComponent recordCategory = filePlanComponentAPI.createFilePlanComponent(recordCategoryModel, FILE_PLAN_ALIAS.toString());
|
||||||
|
|
||||||
// iterate through all invalid parent containers and try to create/file an electronic record
|
// iterate through all invalid parent containers and try to create/file an electronic record
|
||||||
asList(FILE_PLAN_ALIAS.toString(), TRANSFERS_ALIAS.toString(), HOLDS_ALIAS.toString(), recordCategory.getId())
|
asList(FILE_PLAN_ALIAS.toString(), TRANSFERS_ALIAS.toString(), HOLDS_ALIAS.toString(), recordCategory.getId())
|
||||||
.stream()
|
.stream()
|
||||||
.forEach(id ->
|
.forEach(id ->
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -118,7 +119,7 @@ public class NonElectronicRecordTests extends BaseRestTest
|
|||||||
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(UNPROCESSABLE_ENTITY);
|
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(UNPROCESSABLE_ENTITY);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* Given a parent container that is a record folder
|
* Given a parent container that is a record folder
|
||||||
@@ -144,14 +145,14 @@ public class NonElectronicRecordTests extends BaseRestTest
|
|||||||
public void canCreateInValidContainers(FilePlanComponent container) throws Exception
|
public void canCreateInValidContainers(FilePlanComponent container) throws Exception
|
||||||
{
|
{
|
||||||
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||||
|
|
||||||
logger.info("Root container:\n" + toJson(container));
|
logger.info("Root container:\n" + toJson(container));
|
||||||
if (container.getNodeType().equals(RECORD_FOLDER_TYPE.toString()))
|
if (container.getNodeType().equals(RECORD_FOLDER_TYPE.toString()))
|
||||||
{
|
{
|
||||||
// only record folders can be open or closed
|
// only record folders can be open or closed
|
||||||
assertFalse(container.getProperties().getIsClosed());
|
assertFalse(container.getProperties().getIsClosed());
|
||||||
}
|
}
|
||||||
|
|
||||||
// use these properties for non-electronic record to be created
|
// use these properties for non-electronic record to be created
|
||||||
String title = "Title " + getRandomAlphanumeric();
|
String title = "Title " + getRandomAlphanumeric();
|
||||||
String description = "Description " + getRandomAlphanumeric();
|
String description = "Description " + getRandomAlphanumeric();
|
||||||
@@ -159,33 +160,38 @@ public class NonElectronicRecordTests extends BaseRestTest
|
|||||||
String file = "File " + getRandomAlphanumeric();
|
String file = "File " + getRandomAlphanumeric();
|
||||||
String shelf = "Shelf " + getRandomAlphanumeric();
|
String shelf = "Shelf " + getRandomAlphanumeric();
|
||||||
String location = "Location " + getRandomAlphanumeric();
|
String location = "Location " + getRandomAlphanumeric();
|
||||||
|
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
Integer copies = random.nextInt(Integer.MAX_VALUE);
|
Integer copies = random.nextInt(Integer.MAX_VALUE);
|
||||||
Integer size = random.nextInt(Integer.MAX_VALUE);
|
Integer size = random.nextInt(Integer.MAX_VALUE);
|
||||||
|
|
||||||
// set values of all available properties
|
// set values of all available properties for the non electronic records
|
||||||
FilePlanComponentProperties properties = new FilePlanComponentProperties(title, description);
|
FilePlanComponent filePlanComponent = FilePlanComponent.builder()
|
||||||
properties.setBox(box);
|
.name("Record " + getRandomAlphanumeric())
|
||||||
properties.setFile(file);
|
.nodeType(NON_ELECTRONIC_RECORD_TYPE.toString())
|
||||||
properties.setShelf(shelf);
|
.properties(FilePlanComponentProperties.builder()
|
||||||
properties.setLocation(location);
|
.title(title)
|
||||||
properties.setNumberOfCopies(copies);
|
.description(description)
|
||||||
properties.setPhysicalSize(size);
|
.box(box)
|
||||||
|
.file(file)
|
||||||
|
.shelf(shelf)
|
||||||
|
.location(location)
|
||||||
|
.numberOfCopies(copies)
|
||||||
|
.physicalSize(size)
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
// create non-electronic record
|
// create non-electronic record
|
||||||
String nonElectronicId = filePlanComponentAPI.createFilePlanComponent(
|
String nonElectronicId = filePlanComponentAPI.createFilePlanComponent(
|
||||||
new FilePlanComponent("Record " + getRandomAlphanumeric(),
|
filePlanComponent,
|
||||||
NON_ELECTRONIC_RECORD_TYPE.toString(),
|
|
||||||
properties),
|
|
||||||
container.getId()).getId();
|
container.getId()).getId();
|
||||||
|
|
||||||
// verify the create request status code
|
// verify the create request status code
|
||||||
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(CREATED);
|
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(CREATED);
|
||||||
|
|
||||||
// get newly created non-electonic record and verify its properties
|
// get newly created non-electonic record and verify its properties
|
||||||
FilePlanComponent nonElectronicRecord = filePlanComponentAPI.getFilePlanComponent(nonElectronicId);
|
FilePlanComponent nonElectronicRecord = filePlanComponentAPI.getFilePlanComponent(nonElectronicId);
|
||||||
|
|
||||||
assertEquals(title, nonElectronicRecord.getProperties().getTitle());
|
assertEquals(title, nonElectronicRecord.getProperties().getTitle());
|
||||||
assertEquals(description, nonElectronicRecord.getProperties().getDescription());
|
assertEquals(description, nonElectronicRecord.getProperties().getDescription());
|
||||||
assertEquals(box, nonElectronicRecord.getProperties().getBox());
|
assertEquals(box, nonElectronicRecord.getProperties().getBox());
|
||||||
@@ -195,11 +201,11 @@ public class NonElectronicRecordTests extends BaseRestTest
|
|||||||
assertEquals(copies, nonElectronicRecord.getProperties().getNumberOfCopies());
|
assertEquals(copies, nonElectronicRecord.getProperties().getNumberOfCopies());
|
||||||
assertEquals(size, nonElectronicRecord.getProperties().getPhysicalSize());
|
assertEquals(size, nonElectronicRecord.getProperties().getPhysicalSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* Given a parent container that is a record folder
|
* Given a parent container that is a record folder
|
||||||
* And the record folder is closed
|
* And the record folder is closed
|
||||||
* When I try to create a non-electronic record within the parent container
|
* When I try to create a non-electronic record within the parent container
|
||||||
* Then nothing happens
|
* Then nothing happens
|
||||||
* And an error is reported
|
* And an error is reported
|
||||||
@@ -211,21 +217,22 @@ public class NonElectronicRecordTests extends BaseRestTest
|
|||||||
{
|
{
|
||||||
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||||
FilePlanComponent recordFolder = createCategoryFolderInFilePlan(dataUser.getAdminUser(), FILE_PLAN_ALIAS.toString());
|
FilePlanComponent recordFolder = createCategoryFolderInFilePlan(dataUser.getAdminUser(), FILE_PLAN_ALIAS.toString());
|
||||||
|
|
||||||
// the folder should be open
|
// the folder should be open
|
||||||
assertFalse(recordFolder.getProperties().getIsClosed());
|
assertFalse(recordFolder.getProperties().getIsClosed());
|
||||||
|
|
||||||
// close the folder
|
// close the folder
|
||||||
closeFolder(recordFolder.getId());
|
closeFolder(recordFolder.getId());
|
||||||
|
|
||||||
// try to create it, this should fail and throw an exception
|
// try to create it, this should fail and throw an exception
|
||||||
|
|
||||||
filePlanComponentAPI.createFilePlanComponent(
|
filePlanComponentAPI.createFilePlanComponent(FilePlanComponent.builder()
|
||||||
new FilePlanComponent("Record " + getRandomAlphanumeric(),
|
.name("Record " + getRandomAlphanumeric())
|
||||||
NON_ELECTRONIC_RECORD_TYPE.toString(),
|
.nodeType(NON_ELECTRONIC_RECORD_TYPE.toString())
|
||||||
new FilePlanComponentProperties()),
|
.build(),
|
||||||
recordFolder.getId()).getId();
|
recordFolder.getId())
|
||||||
|
.getId();
|
||||||
|
|
||||||
// verify the status code
|
// verify the status code
|
||||||
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(UNPROCESSABLE_ENTITY);
|
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(UNPROCESSABLE_ENTITY);
|
||||||
}
|
}
|
||||||
@@ -251,31 +258,32 @@ public class NonElectronicRecordTests extends BaseRestTest
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
(
|
(
|
||||||
dataProvider = "validRootContainers",
|
dataProvider = "validRootContainers",
|
||||||
description = "Non-electronic record can only be created if all mandatory properties are given"
|
description = "Non-electronic record can only be created if all mandatory properties are given"
|
||||||
)
|
)
|
||||||
public void allMandatoryPropertiesRequired(FilePlanComponent container) throws Exception
|
public void allMandatoryPropertiesRequired(FilePlanComponent container) throws Exception
|
||||||
{
|
{
|
||||||
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||||
|
|
||||||
logger.info("Root container:\n" + toJson(container));
|
logger.info("Root container:\n" + toJson(container));
|
||||||
if (container.getNodeType().equals(RECORD_FOLDER_TYPE.toString()))
|
if (container.getNodeType().equals(RECORD_FOLDER_TYPE.toString()))
|
||||||
{
|
{
|
||||||
// only record folders can be open or closed
|
// only record folders can be open or closed
|
||||||
assertFalse(container.getProperties().getIsClosed());
|
assertFalse(container.getProperties().getIsClosed());
|
||||||
}
|
}
|
||||||
|
|
||||||
// component without name and title
|
// component without name and title
|
||||||
FilePlanComponent noNameOrTitle = getDummyNonElectronicRecord();
|
FilePlanComponent noNameOrTitle = getDummyNonElectronicRecord();
|
||||||
|
|
||||||
// component with title only
|
// component with title only
|
||||||
FilePlanComponent titleOnly = getDummyNonElectronicRecord();
|
FilePlanComponent titleOnly = getDummyNonElectronicRecord();
|
||||||
FilePlanComponentProperties properties = new FilePlanComponentProperties();
|
FilePlanComponentProperties properties = FilePlanComponentProperties.builder()
|
||||||
properties.setTitle("Title " + getRandomAlphanumeric());
|
.title("Title " + getRandomAlphanumeric())
|
||||||
|
.build();
|
||||||
titleOnly.setProperties(properties);
|
titleOnly.setProperties(properties);
|
||||||
|
|
||||||
// try to create invalid components
|
// try to create invalid components
|
||||||
asList(noNameOrTitle, titleOnly).stream().forEach(c ->
|
asList(noNameOrTitle, titleOnly).stream().forEach(c ->
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -284,21 +292,21 @@ public class NonElectronicRecordTests extends BaseRestTest
|
|||||||
catch (Exception error)
|
catch (Exception error)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// this should fail and throw an exception
|
// this should fail and throw an exception
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
filePlanComponentAPI.createFilePlanComponent(c, container.getId());
|
filePlanComponentAPI.createFilePlanComponent(c, container.getId());
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// verify the status code is BAD_REQUEST
|
// verify the status code is BAD_REQUEST
|
||||||
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(BAD_REQUEST);
|
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(BAD_REQUEST);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* Given that I am a user without RM privileges
|
* Given that I am a user without RM privileges
|
||||||
@@ -310,7 +318,7 @@ public class NonElectronicRecordTests extends BaseRestTest
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
(
|
(
|
||||||
dataProvider = "validRootContainers",
|
dataProvider = "validRootContainers",
|
||||||
description = "Non-electronic record can't be created if user doesn't have RM privileges"
|
description = "Non-electronic record can't be created if user doesn't have RM privileges"
|
||||||
)
|
)
|
||||||
public void cantCreateIfNoRmPrivileges(FilePlanComponent container) throws Exception
|
public void cantCreateIfNoRmPrivileges(FilePlanComponent container) throws Exception
|
||||||
@@ -319,16 +327,23 @@ public class NonElectronicRecordTests extends BaseRestTest
|
|||||||
UserModel user = createUserWithRole(username, UserRole.SiteManager);
|
UserModel user = createUserWithRole(username, UserRole.SiteManager);
|
||||||
|
|
||||||
filePlanComponentAPI.usingRestWrapper().authenticateUser(user);
|
filePlanComponentAPI.usingRestWrapper().authenticateUser(user);
|
||||||
|
|
||||||
// try to create a fileplan component
|
// try to create a fileplan component
|
||||||
FilePlanComponent record = new FilePlanComponent("Record Name", NON_ELECTRONIC_RECORD_TYPE.toString(),
|
FilePlanComponent record=FilePlanComponent.builder()
|
||||||
new FilePlanComponentProperties("Name", "Title"));
|
.properties(FilePlanComponentProperties.builder()
|
||||||
|
.description("Description")
|
||||||
|
.title("Title")
|
||||||
|
.build())
|
||||||
|
.name("Record Name")
|
||||||
|
.nodeType(NON_ELECTRONIC_RECORD_TYPE.toString())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
|
||||||
// this should fail and throw an exception
|
// this should fail and throw an exception
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
filePlanComponentAPI.createFilePlanComponent(record, container.getId());
|
filePlanComponentAPI.createFilePlanComponent(record, container.getId());
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -336,18 +351,19 @@ public class NonElectronicRecordTests extends BaseRestTest
|
|||||||
// user who isn't an RM site member can't access the container path
|
// user who isn't an RM site member can't access the container path
|
||||||
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(FORBIDDEN);
|
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(FORBIDDEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper function to return an empty FilePlanComponent for non-electronic record
|
* Helper function to return an empty FilePlanComponent for non-electronic record
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private FilePlanComponent getDummyNonElectronicRecord()
|
private FilePlanComponent getDummyNonElectronicRecord()
|
||||||
{
|
{
|
||||||
FilePlanComponent component = new FilePlanComponent();
|
FilePlanComponent component=FilePlanComponent.builder()
|
||||||
component.setNodeType(NON_ELECTRONIC_RECORD_TYPE.toString());
|
.nodeType(NON_ELECTRONIC_RECORD_TYPE.toString())
|
||||||
|
.build();
|
||||||
return component;
|
return component;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create user with given role and add it to RM site
|
* Create user with given role and add it to RM site
|
||||||
* <br>
|
* <br>
|
||||||
@@ -369,13 +385,13 @@ public class NonElectronicRecordTests extends BaseRestTest
|
|||||||
UserModel user = new UserModel();
|
UserModel user = new UserModel();
|
||||||
user.setUsername(userName);
|
user.setUsername(userName);
|
||||||
user.setPassword(userName);
|
user.setPassword(userName);
|
||||||
|
|
||||||
if (!dataUser.isUserInRepo(userName))
|
if (!dataUser.isUserInRepo(userName))
|
||||||
{
|
{
|
||||||
// user doesn't exist, create it
|
// user doesn't exist, create it
|
||||||
user = dataUser.createUser(userName, userName);
|
user = dataUser.createUser(userName, userName);
|
||||||
user.setUserRole(userRole);
|
user.setUserRole(userRole);
|
||||||
|
|
||||||
dataUser.addUserToSite(user, new SiteModel(siteId), userRole);
|
dataUser.addUserToSite(user, new SiteModel(siteId), userRole);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -94,8 +94,15 @@ public class RecordCategoryTest extends BaseRestTest
|
|||||||
String categoryTitle = "Category title " + getRandomAlphanumeric();
|
String categoryTitle = "Category title " + getRandomAlphanumeric();
|
||||||
|
|
||||||
// Build the record category properties
|
// Build the record category properties
|
||||||
FilePlanComponent recordCategory = new FilePlanComponent(categoryName,RECORD_CATEGORY_TYPE.toString(),
|
FilePlanComponent recordCategory = FilePlanComponent.builder()
|
||||||
new FilePlanComponentProperties(categoryTitle));
|
.name(categoryName)
|
||||||
|
.nodeType(RECORD_CATEGORY_TYPE.toString())
|
||||||
|
.properties(
|
||||||
|
FilePlanComponentProperties.builder()
|
||||||
|
.title(categoryTitle)
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
// Create the record category
|
// Create the record category
|
||||||
FilePlanComponent filePlanComponent = filePlanComponentAPI.createFilePlanComponent(recordCategory, FILE_PLAN_ALIAS.toString());
|
FilePlanComponent filePlanComponent = filePlanComponentAPI.createFilePlanComponent(recordCategory, FILE_PLAN_ALIAS.toString());
|
||||||
|
|
||||||
@@ -103,9 +110,9 @@ public class RecordCategoryTest extends BaseRestTest
|
|||||||
restWrapper.assertStatusCodeIs(CREATED);
|
restWrapper.assertStatusCodeIs(CREATED);
|
||||||
|
|
||||||
// Verify the returned file plan component
|
// Verify the returned file plan component
|
||||||
assertTrue(filePlanComponent.isCategory());
|
assertTrue(filePlanComponent.getIsCategory());
|
||||||
assertFalse(filePlanComponent.isFile());
|
assertFalse(filePlanComponent.getIsFile());
|
||||||
assertFalse(filePlanComponent.isRecordFolder());
|
assertFalse(filePlanComponent.getIsRecordFolder());
|
||||||
|
|
||||||
assertEquals(filePlanComponent.getName(), categoryName);
|
assertEquals(filePlanComponent.getName(), categoryName);
|
||||||
assertEquals(filePlanComponent.getNodeType(), RECORD_CATEGORY_TYPE.toString());
|
assertEquals(filePlanComponent.getNodeType(), RECORD_CATEGORY_TYPE.toString());
|
||||||
@@ -139,8 +146,14 @@ public class RecordCategoryTest extends BaseRestTest
|
|||||||
String categoryTitle = "Category title " + getRandomAlphanumeric();
|
String categoryTitle = "Category title " + getRandomAlphanumeric();
|
||||||
|
|
||||||
// Build the record category properties
|
// Build the record category properties
|
||||||
FilePlanComponent recordCategory = new FilePlanComponent(categoryName, RECORD_CATEGORY_TYPE.toString(),
|
FilePlanComponent recordCategory = FilePlanComponent.builder()
|
||||||
new FilePlanComponentProperties(categoryTitle));
|
.name(categoryName)
|
||||||
|
.nodeType(RECORD_CATEGORY_TYPE.toString())
|
||||||
|
.properties(
|
||||||
|
FilePlanComponentProperties.builder()
|
||||||
|
.title(categoryTitle)
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
// Create the record category
|
// Create the record category
|
||||||
FilePlanComponent filePlanComponent = filePlanComponentAPI.createFilePlanComponent(recordCategory, FILE_PLAN_ALIAS.toString());
|
FilePlanComponent filePlanComponent = filePlanComponentAPI.createFilePlanComponent(recordCategory, FILE_PLAN_ALIAS.toString());
|
||||||
@@ -148,7 +161,7 @@ public class RecordCategoryTest extends BaseRestTest
|
|||||||
String newCategoryName = "Rename " + categoryName;
|
String newCategoryName = "Rename " + categoryName;
|
||||||
|
|
||||||
// Build the properties which will be updated
|
// Build the properties which will be updated
|
||||||
FilePlanComponent recordCategoryUpdated = new FilePlanComponent(newCategoryName);
|
FilePlanComponent recordCategoryUpdated = FilePlanComponent.builder().name(newCategoryName).build();
|
||||||
|
|
||||||
// Update the record category
|
// Update the record category
|
||||||
FilePlanComponent renamedFilePlanComponent = filePlanComponentAPI.updateFilePlanComponent(recordCategoryUpdated, filePlanComponent.getId());
|
FilePlanComponent renamedFilePlanComponent = filePlanComponentAPI.updateFilePlanComponent(recordCategoryUpdated, filePlanComponent.getId());
|
||||||
@@ -186,8 +199,15 @@ public class RecordCategoryTest extends BaseRestTest
|
|||||||
String categoryTitle = "Category title " + getRandomAlphanumeric();
|
String categoryTitle = "Category title " + getRandomAlphanumeric();
|
||||||
|
|
||||||
// Build the record category properties
|
// Build the record category properties
|
||||||
FilePlanComponent recordCategory = new FilePlanComponent(categoryName, RECORD_CATEGORY_TYPE.toString(),
|
FilePlanComponent recordCategory = FilePlanComponent.builder()
|
||||||
new FilePlanComponentProperties(categoryTitle));
|
.name(categoryName)
|
||||||
|
.nodeType(RECORD_CATEGORY_TYPE.toString())
|
||||||
|
.properties(
|
||||||
|
FilePlanComponentProperties.builder()
|
||||||
|
.title(categoryTitle)
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
// Create the record category
|
// Create the record category
|
||||||
FilePlanComponent filePlanComponent = filePlanComponentAPI.createFilePlanComponent(recordCategory, FILE_PLAN_ALIAS.toString());
|
FilePlanComponent filePlanComponent = filePlanComponentAPI.createFilePlanComponent(recordCategory, FILE_PLAN_ALIAS.toString());
|
||||||
|
|
||||||
@@ -226,9 +246,9 @@ public class RecordCategoryTest extends BaseRestTest
|
|||||||
|
|
||||||
// Verify child category
|
// Verify child category
|
||||||
assertEquals(childCategory.getParentId(), rootCategory.getId());
|
assertEquals(childCategory.getParentId(), rootCategory.getId());
|
||||||
assertTrue(childCategory.isCategory());
|
assertTrue(childCategory.getIsCategory());
|
||||||
assertFalse(childCategory.isFile());
|
assertFalse(childCategory.getIsFile());
|
||||||
assertFalse(childCategory.isRecordFolder());
|
assertFalse(childCategory.getIsRecordFolder());
|
||||||
assertEquals(childCategory.getNodeType(), RECORD_CATEGORY_TYPE.toString());
|
assertEquals(childCategory.getNodeType(), RECORD_CATEGORY_TYPE.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -295,19 +315,19 @@ public class RecordCategoryTest extends BaseRestTest
|
|||||||
assertEquals(filePlanComponent.getParentId(), rootCategory.getId());
|
assertEquals(filePlanComponent.getParentId(), rootCategory.getId());
|
||||||
|
|
||||||
// Only categories or folders have been created
|
// Only categories or folders have been created
|
||||||
assertFalse(filePlanComponent.isFile());
|
assertFalse(filePlanComponent.getIsFile());
|
||||||
|
|
||||||
// Boolean properties related to node type
|
// Boolean properties related to node type
|
||||||
// Only RECORD_CATEGORY_TYPE and RECORD_FOLDER_TYPE have been created
|
// Only RECORD_CATEGORY_TYPE and RECORD_FOLDER_TYPE have been created
|
||||||
if (filePlanComponent.getNodeType().equals(RECORD_CATEGORY_TYPE.toString()))
|
if (filePlanComponent.getNodeType().equals(RECORD_CATEGORY_TYPE.toString()))
|
||||||
{
|
{
|
||||||
assertTrue(filePlanComponent.isCategory());
|
assertTrue(filePlanComponent.getIsCategory());
|
||||||
assertFalse(filePlanComponent.isRecordFolder());
|
assertFalse(filePlanComponent.getIsRecordFolder());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
assertTrue(filePlanComponent.isRecordFolder());
|
assertTrue(filePlanComponent.getIsRecordFolder());
|
||||||
assertFalse(filePlanComponent.isCategory());
|
assertFalse(filePlanComponent.getIsCategory());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Does returned object have the same contents as the created one?
|
// Does returned object have the same contents as the created one?
|
||||||
@@ -348,8 +368,14 @@ public class RecordCategoryTest extends BaseRestTest
|
|||||||
FilePlanComponent category = createCategory(FILE_PLAN_ALIAS.toString(), COMPONENT_NAME);
|
FilePlanComponent category = createCategory(FILE_PLAN_ALIAS.toString(), COMPONENT_NAME);
|
||||||
|
|
||||||
//Build node properties
|
//Build node properties
|
||||||
FilePlanComponent recordCategory = new FilePlanComponent(COMPONENT_NAME,nodeType,
|
FilePlanComponent recordCategory = FilePlanComponent.builder()
|
||||||
new FilePlanComponentProperties("Title for " + COMPONENT_NAME));
|
.name(COMPONENT_NAME)
|
||||||
|
.nodeType(nodeType)
|
||||||
|
.properties(
|
||||||
|
FilePlanComponentProperties.builder()
|
||||||
|
.title("Title for " + COMPONENT_NAME)
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
//create the invalid node type
|
//create the invalid node type
|
||||||
filePlanComponentAPI.createFilePlanComponent(recordCategory, category.getId());
|
filePlanComponentAPI.createFilePlanComponent(recordCategory, category.getId());
|
||||||
@@ -383,8 +409,14 @@ public class RecordCategoryTest extends BaseRestTest
|
|||||||
{
|
{
|
||||||
RestWrapper restWrapper = filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
RestWrapper restWrapper = filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||||
//Build node properties
|
//Build node properties
|
||||||
FilePlanComponent component = new FilePlanComponent(componentName, componentType.toString(),
|
FilePlanComponent component = FilePlanComponent.builder()
|
||||||
new FilePlanComponentProperties("Title for " + componentName));
|
.name(componentName)
|
||||||
|
.nodeType(componentType.toString())
|
||||||
|
.properties(FilePlanComponentProperties.builder()
|
||||||
|
.title("Title for " + componentName)
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
FilePlanComponent fpc = filePlanComponentAPI.createFilePlanComponent(component, parentComponentId);
|
FilePlanComponent fpc = filePlanComponentAPI.createFilePlanComponent(component, parentComponentId);
|
||||||
restWrapper.assertStatusCodeIs(CREATED);
|
restWrapper.assertStatusCodeIs(CREATED);
|
||||||
return fpc;
|
return fpc;
|
||||||
|
@@ -93,8 +93,13 @@ public class RecordFolderTests extends BaseRestTest
|
|||||||
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||||
FilePlanComponent filePlanComponent = createCategory(FILE_PLAN_ALIAS.toString(), CATEGORY);
|
FilePlanComponent filePlanComponent = createCategory(FILE_PLAN_ALIAS.toString(), CATEGORY);
|
||||||
|
|
||||||
FilePlanComponentProperties filePlanComponentProperties = new FilePlanComponentProperties(FOLDER_TITLE);
|
FilePlanComponent recordFolder = FilePlanComponent.builder()
|
||||||
FilePlanComponent recordFolder = new FilePlanComponent(FOLDER_NAME,RECORD_FOLDER_TYPE.toString(), filePlanComponentProperties);
|
.name(FOLDER_NAME)
|
||||||
|
.nodeType(RECORD_FOLDER_TYPE.toString())
|
||||||
|
.properties(FilePlanComponentProperties.builder()
|
||||||
|
.title(FOLDER_TITLE)
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
// Create the record folder
|
// Create the record folder
|
||||||
FilePlanComponent folder = filePlanComponentAPI.createFilePlanComponent(recordFolder, filePlanComponent.getId());
|
FilePlanComponent folder = filePlanComponentAPI.createFilePlanComponent(recordFolder, filePlanComponent.getId());
|
||||||
@@ -105,9 +110,9 @@ public class RecordFolderTests extends BaseRestTest
|
|||||||
// Check folder has been created within the category created
|
// Check folder has been created within the category created
|
||||||
assertEquals(filePlanComponent.getId(),folder.getParentId());
|
assertEquals(filePlanComponent.getId(),folder.getParentId());
|
||||||
// Verify the returned properties for the file plan component - record folder
|
// Verify the returned properties for the file plan component - record folder
|
||||||
assertFalse(folder.isCategory());
|
assertFalse(folder.getIsCategory());
|
||||||
assertFalse(folder.isFile());
|
assertFalse(folder.getIsFile());
|
||||||
assertTrue(folder.isRecordFolder());
|
assertTrue(folder.getIsRecordFolder());
|
||||||
|
|
||||||
assertEquals(folder.getName(), FOLDER_NAME);
|
assertEquals(folder.getName(), FOLDER_NAME);
|
||||||
assertEquals(folder.getNodeType(), RECORD_FOLDER_TYPE.toString());
|
assertEquals(folder.getNodeType(), RECORD_FOLDER_TYPE.toString());
|
||||||
@@ -138,8 +143,14 @@ public class RecordFolderTests extends BaseRestTest
|
|||||||
String componentID = filePlanComponentAPI.getFilePlanComponent(filePlanComponent).getId();
|
String componentID = filePlanComponentAPI.getFilePlanComponent(filePlanComponent).getId();
|
||||||
|
|
||||||
// Build the record category properties
|
// Build the record category properties
|
||||||
FilePlanComponent recordFolder = new FilePlanComponent(FOLDER_NAME,RECORD_FOLDER_TYPE.toString(),
|
FilePlanComponent recordFolder = FilePlanComponent.builder()
|
||||||
new FilePlanComponentProperties(FOLDER_TITLE));
|
.name(FOLDER_NAME)
|
||||||
|
.nodeType(RECORD_FOLDER_TYPE.toString())
|
||||||
|
.properties(FilePlanComponentProperties.builder()
|
||||||
|
.title(FOLDER_TITLE)
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
// Create a record folder
|
// Create a record folder
|
||||||
filePlanComponentAPI.createFilePlanComponent(recordFolder, componentID);
|
filePlanComponentAPI.createFilePlanComponent(recordFolder, componentID);
|
||||||
|
|
||||||
@@ -168,10 +179,10 @@ public class RecordFolderTests extends BaseRestTest
|
|||||||
|
|
||||||
// Verify the returned properties for the file plan component - record folder
|
// Verify the returned properties for the file plan component - record folder
|
||||||
assertEquals(RECORD_FOLDER_TYPE.toString(),folderDetails.getNodeType());
|
assertEquals(RECORD_FOLDER_TYPE.toString(),folderDetails.getNodeType());
|
||||||
assertTrue(folderDetails.isRecordFolder());
|
assertTrue(folderDetails.getIsRecordFolder());
|
||||||
assertFalse(folderDetails.isCategory());
|
assertFalse(folderDetails.getIsCategory());
|
||||||
assertFalse(folderDetails.isFile());
|
assertFalse(folderDetails.getIsFile());
|
||||||
assertFalse(folderDetails.isClosed());
|
assertFalse(folderDetails.getIsClosed());
|
||||||
|
|
||||||
assertEquals(FOLDER_NAME,folderDetails.getName());
|
assertEquals(FOLDER_NAME,folderDetails.getName());
|
||||||
assertEquals(dataUser.getAdminUser().getUsername(),folderDetails.getCreatedByUser().getId());
|
assertEquals(dataUser.getAdminUser().getUsername(),folderDetails.getCreatedByUser().getId());
|
||||||
@@ -210,11 +221,16 @@ public class RecordFolderTests extends BaseRestTest
|
|||||||
String location = "Location"+getRandomAlphanumeric();
|
String location = "Location"+getRandomAlphanumeric();
|
||||||
|
|
||||||
//Create the file plan component properties to update
|
//Create the file plan component properties to update
|
||||||
FilePlanComponentProperties filePlanComponentProperties = new FilePlanComponentProperties(folderTitle, folderDescription);
|
FilePlanComponent recordFolder = FilePlanComponent.builder()
|
||||||
filePlanComponentProperties.setVitalRecord(true);
|
.name(folderName)
|
||||||
filePlanComponentProperties.setReviewPeriod( new ReviewPeriod("month","1"));
|
.properties(FilePlanComponentProperties.builder()
|
||||||
filePlanComponentProperties.setLocation(location);
|
.title(folderTitle)
|
||||||
FilePlanComponent recordFolder = new FilePlanComponent(folderName,filePlanComponentProperties);
|
.description(folderDescription)
|
||||||
|
.vitalRecord(true)
|
||||||
|
.reviewPeriod(new ReviewPeriod("month","1"))
|
||||||
|
.location(location)
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
// Update the record category
|
// Update the record category
|
||||||
FilePlanComponent folderUpdated = filePlanComponentAPI.updateFilePlanComponent(recordFolder, folder.getId());
|
FilePlanComponent folderUpdated = filePlanComponentAPI.updateFilePlanComponent(recordFolder, folder.getId());
|
||||||
@@ -226,7 +242,7 @@ public class RecordFolderTests extends BaseRestTest
|
|||||||
assertEquals(folderName, folderUpdated.getName());
|
assertEquals(folderName, folderUpdated.getName());
|
||||||
assertEquals(folderDescription, folderUpdated.getProperties().getDescription());
|
assertEquals(folderDescription, folderUpdated.getProperties().getDescription());
|
||||||
assertEquals(folderTitle, folderUpdated.getProperties().getTitle());
|
assertEquals(folderTitle, folderUpdated.getProperties().getTitle());
|
||||||
assertTrue(folderUpdated.getProperties().isVitalRecord());
|
assertTrue(folderUpdated.getProperties().getVitalRecord());
|
||||||
assertEquals(location, folderUpdated.getProperties().getLocation());
|
assertEquals(location, folderUpdated.getProperties().getLocation());
|
||||||
assertNotNull(folderUpdated.getProperties().getReviewPeriod().getPeriodType());
|
assertNotNull(folderUpdated.getProperties().getReviewPeriod().getPeriodType());
|
||||||
assertNotNull(folderUpdated.getProperties().getReviewPeriod().getExpression());
|
assertNotNull(folderUpdated.getProperties().getReviewPeriod().getExpression());
|
||||||
@@ -324,11 +340,11 @@ public class RecordFolderTests extends BaseRestTest
|
|||||||
|
|
||||||
// Is parent Id set correctly
|
// Is parent Id set correctly
|
||||||
assertEquals(filePlanComponent.getParentId(), category.getId());
|
assertEquals(filePlanComponent.getParentId(), category.getId());
|
||||||
assertFalse(filePlanComponent.isFile());
|
assertFalse(filePlanComponent.getIsFile());
|
||||||
|
|
||||||
// Boolean properties related to node type
|
// Boolean properties related to node type
|
||||||
assertTrue(filePlanComponent.isRecordFolder());
|
assertTrue(filePlanComponent.getIsRecordFolder());
|
||||||
assertFalse(filePlanComponent.isCategory());
|
assertFalse(filePlanComponent.getIsCategory());
|
||||||
|
|
||||||
assertEquals(createdComponent.getName(), filePlanComponent.getName());
|
assertEquals(createdComponent.getName(), filePlanComponent.getName());
|
||||||
assertEquals(createdComponent.getNodeType(), filePlanComponent.getNodeType());
|
assertEquals(createdComponent.getNodeType(), filePlanComponent.getNodeType());
|
||||||
|
@@ -107,8 +107,14 @@ public class UnfiledRecordsFolderTests extends BaseRestTest
|
|||||||
String folderDescription = folderName + " Description";
|
String folderDescription = folderName + " Description";
|
||||||
|
|
||||||
// Build unfiled records folder properties
|
// Build unfiled records folder properties
|
||||||
FilePlanComponent unfiledFolder=new FilePlanComponent(folderName,UNFILED_RECORD_FOLDER_TYPE.toString(),
|
FilePlanComponent unfiledFolder = FilePlanComponent.builder()
|
||||||
new FilePlanComponentProperties(folderTitle,folderDescription));
|
.name(folderName)
|
||||||
|
.nodeType(UNFILED_RECORD_FOLDER_TYPE.toString())
|
||||||
|
.properties(FilePlanComponentProperties.builder()
|
||||||
|
.title(folderTitle)
|
||||||
|
.description(folderDescription)
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
FilePlanComponent filePlanComponent = filePlanComponentAPI.createFilePlanComponent(unfiledFolder,
|
FilePlanComponent filePlanComponent = filePlanComponentAPI.createFilePlanComponent(unfiledFolder,
|
||||||
UNFILED_RECORDS_CONTAINER_ALIAS.toString());
|
UNFILED_RECORDS_CONTAINER_ALIAS.toString());
|
||||||
@@ -117,9 +123,9 @@ public class UnfiledRecordsFolderTests extends BaseRestTest
|
|||||||
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(CREATED);
|
filePlanComponentAPI.usingRestWrapper().assertStatusCodeIs(CREATED);
|
||||||
|
|
||||||
// Verify the returned file plan component
|
// Verify the returned file plan component
|
||||||
assertFalse(filePlanComponent.isCategory());
|
assertFalse(filePlanComponent.getIsCategory());
|
||||||
assertFalse(filePlanComponent.isFile());
|
assertFalse(filePlanComponent.getIsFile());
|
||||||
assertFalse(filePlanComponent.isRecordFolder()); // it is not a _normal_ record folder!
|
assertFalse(filePlanComponent.getIsRecordFolder()); // it is not a _normal_ record folder!
|
||||||
|
|
||||||
assertEquals(filePlanComponent.getName(), folderName);
|
assertEquals(filePlanComponent.getName(), folderName);
|
||||||
assertEquals(filePlanComponent.getNodeType(), UNFILED_RECORD_FOLDER_TYPE.toString());
|
assertEquals(filePlanComponent.getNodeType(), UNFILED_RECORD_FOLDER_TYPE.toString());
|
||||||
@@ -151,8 +157,14 @@ public class UnfiledRecordsFolderTests extends BaseRestTest
|
|||||||
logger.info("creating " + componentType.toString());
|
logger.info("creating " + componentType.toString());
|
||||||
|
|
||||||
// Build unfiled records folder properties
|
// Build unfiled records folder properties
|
||||||
FilePlanComponent unfiledFolder = new FilePlanComponent(folderName, componentType.toString(),
|
FilePlanComponent unfiledFolder = FilePlanComponent.builder()
|
||||||
new FilePlanComponentProperties(folderTitle, folderDescription));
|
.name(folderName)
|
||||||
|
.nodeType(componentType.toString())
|
||||||
|
.properties(FilePlanComponentProperties.builder()
|
||||||
|
.title(folderTitle)
|
||||||
|
.description(folderDescription)
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -189,8 +201,14 @@ public class UnfiledRecordsFolderTests extends BaseRestTest
|
|||||||
assertEquals(parentFolderName, parentFolder.getName());
|
assertEquals(parentFolderName, parentFolder.getName());
|
||||||
|
|
||||||
// Build the unfiled records folder properties
|
// Build the unfiled records folder properties
|
||||||
FilePlanComponent unfiledFolder = new FilePlanComponent(childFolderName, UNFILED_RECORD_FOLDER_TYPE.toString(),
|
FilePlanComponent unfiledFolder = FilePlanComponent.builder()
|
||||||
new FilePlanComponentProperties(childFolderTitle, childFolderDescription));
|
.name(childFolderName)
|
||||||
|
.nodeType(UNFILED_RECORD_FOLDER_TYPE.toString())
|
||||||
|
.properties(FilePlanComponentProperties.builder()
|
||||||
|
.title(childFolderTitle)
|
||||||
|
.description(childFolderDescription)
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
// Create it as a child of parentFolder
|
// Create it as a child of parentFolder
|
||||||
FilePlanComponent childFolder = filePlanComponentAPI.createFilePlanComponent(unfiledFolder,
|
FilePlanComponent childFolder = filePlanComponentAPI.createFilePlanComponent(unfiledFolder,
|
||||||
@@ -200,9 +218,9 @@ public class UnfiledRecordsFolderTests extends BaseRestTest
|
|||||||
restWrapper.assertStatusCodeIs(CREATED);
|
restWrapper.assertStatusCodeIs(CREATED);
|
||||||
|
|
||||||
// Verify the returned file plan component
|
// Verify the returned file plan component
|
||||||
assertFalse(childFolder.isCategory());
|
assertFalse(childFolder.getIsCategory());
|
||||||
assertFalse(childFolder.isFile());
|
assertFalse(childFolder.getIsFile());
|
||||||
assertFalse(childFolder.isRecordFolder()); // it is not a _normal_ record folder!
|
assertFalse(childFolder.getIsRecordFolder()); // it is not a _normal_ record folder!
|
||||||
|
|
||||||
assertEquals(childFolder.getName(), childFolderName);
|
assertEquals(childFolder.getName(), childFolderName);
|
||||||
assertEquals(childFolder.getNodeType(), UNFILED_RECORD_FOLDER_TYPE.toString());
|
assertEquals(childFolder.getNodeType(), UNFILED_RECORD_FOLDER_TYPE.toString());
|
||||||
@@ -251,9 +269,14 @@ public class UnfiledRecordsFolderTests extends BaseRestTest
|
|||||||
assertEquals(folderName, folderToModify.getName());
|
assertEquals(folderName, folderToModify.getName());
|
||||||
|
|
||||||
// Build the properties which will be updated
|
// Build the properties which will be updated
|
||||||
FilePlanComponent folderToUpdate = new FilePlanComponent(modified + folderToModify.getName(),
|
FilePlanComponent folderToUpdate = FilePlanComponent.builder()
|
||||||
new FilePlanComponentProperties(modified + folderToModify.getProperties().getTitle(),
|
.name(modified + folderToModify.getName())
|
||||||
modified + folderToModify.getProperties().getDescription()));
|
.properties(FilePlanComponentProperties.builder().
|
||||||
|
title(modified + folderToModify.getProperties().getTitle()).
|
||||||
|
description(modified + folderToModify.getProperties().getDescription())
|
||||||
|
.build())
|
||||||
|
.build();
|
||||||
|
|
||||||
// Update the unfiled records folder
|
// Update the unfiled records folder
|
||||||
filePlanComponentAPI.updateFilePlanComponent(folderToUpdate, folderToModify.getId());
|
filePlanComponentAPI.updateFilePlanComponent(folderToUpdate, folderToModify.getId());
|
||||||
// Verify the status code
|
// Verify the status code
|
||||||
|
@@ -95,7 +95,10 @@ public class RMSiteTests extends BaseRestTest
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create the RM site
|
// Create the RM site
|
||||||
RMSite rmSite = new RMSite(RM_TITLE, RM_DESCRIPTION, STANDARD);
|
RMSite rmSite =RMSite.builder().compliance(STANDARD).build();
|
||||||
|
rmSite.setTitle(RM_TITLE);
|
||||||
|
rmSite.setDescription(RM_DESCRIPTION);
|
||||||
|
|
||||||
RMSite rmSiteResponse = rmSiteAPI.createRMSite(rmSite);
|
RMSite rmSiteResponse = rmSiteAPI.createRMSite(rmSite);
|
||||||
|
|
||||||
// Verify the status code
|
// Verify the status code
|
||||||
@@ -132,7 +135,10 @@ public class RMSiteTests extends BaseRestTest
|
|||||||
String newDescription = RM_DESCRIPTION + "createRMSiteWhenSiteExists";
|
String newDescription = RM_DESCRIPTION + "createRMSiteWhenSiteExists";
|
||||||
|
|
||||||
// Create the RM site
|
// Create the RM site
|
||||||
RMSite rmSite = new RMSite(newTitle, newDescription, STANDARD);
|
RMSite rmSite = RMSite.builder().compliance(STANDARD).build();
|
||||||
|
rmSite.setTitle(newTitle);
|
||||||
|
rmSite.setDescription(newDescription);
|
||||||
|
|
||||||
rmSiteAPI.createRMSite(rmSite);
|
rmSiteAPI.createRMSite(rmSite);
|
||||||
|
|
||||||
// Verify the status code
|
// Verify the status code
|
||||||
@@ -236,7 +242,9 @@ public class RMSiteTests extends BaseRestTest
|
|||||||
rmSiteAPI.usingRestWrapper().authenticateUser(userModel);
|
rmSiteAPI.usingRestWrapper().authenticateUser(userModel);
|
||||||
|
|
||||||
// Create the RM site
|
// Create the RM site
|
||||||
RMSite rmSite = new RMSite(RM_TITLE, RM_DESCRIPTION, DOD5015);
|
RMSite rmSite = RMSite.builder().compliance(DOD5015).build();
|
||||||
|
rmSite.setTitle(RM_TITLE);
|
||||||
|
rmSite.setDescription(RM_DESCRIPTION);
|
||||||
rmSite=rmSiteAPI.createRMSite(rmSite);
|
rmSite=rmSiteAPI.createRMSite(rmSite);
|
||||||
|
|
||||||
// Verify the status code
|
// Verify the status code
|
||||||
@@ -325,7 +333,7 @@ public class RMSiteTests extends BaseRestTest
|
|||||||
createRMSiteIfNotExists();
|
createRMSiteIfNotExists();
|
||||||
|
|
||||||
// Build the RM site properties
|
// Build the RM site properties
|
||||||
RMSite rmSiteToUpdate = new RMSite(DOD5015);
|
RMSite rmSiteToUpdate = RMSite.builder().compliance(DOD5015).build();
|
||||||
|
|
||||||
// Update the RM site
|
// Update the RM site
|
||||||
rmSiteAPI.updateRMSite(rmSiteToUpdate);
|
rmSiteAPI.updateRMSite(rmSiteToUpdate);
|
||||||
|
Reference in New Issue
Block a user