mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
updates to use Lombok library
This commit is contained in:
@@ -47,67 +47,4 @@ public class FilePlanComponentContent
|
|||||||
@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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -90,7 +90,6 @@ 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;
|
||||||
|
|
||||||
|
@@ -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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -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
|
||||||
@@ -217,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;
|
||||||
@@ -103,8 +102,11 @@ 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
|
||||||
@@ -134,8 +136,10 @@ public class ElectronicRecordTests extends BaseRestTest
|
|||||||
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
|
||||||
@@ -179,9 +183,9 @@ 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());
|
||||||
@@ -216,8 +220,10 @@ public class ElectronicRecordTests extends BaseRestTest
|
|||||||
{
|
{
|
||||||
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
filePlanComponentAPI.usingRestWrapper().authenticateUser(dataUser.getAdminUser());
|
||||||
|
|
||||||
FilePlanComponent record = new FilePlanComponent("Record " + getRandomAlphanumeric(), CONTENT_TYPE.toString(),
|
FilePlanComponent record = FilePlanComponent.builder()
|
||||||
new FilePlanComponentProperties());
|
.name("Record " + getRandomAlphanumeric())
|
||||||
|
.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
|
||||||
|
@@ -89,17 +89,18 @@ public class NonElectronicRecordTests extends BaseRestTest
|
|||||||
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())
|
||||||
@@ -164,20 +165,25 @@ public class NonElectronicRecordTests extends BaseRestTest
|
|||||||
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
|
||||||
@@ -220,11 +226,12 @@ public class NonElectronicRecordTests extends BaseRestTest
|
|||||||
|
|
||||||
// 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);
|
||||||
@@ -270,8 +277,9 @@ public class NonElectronicRecordTests extends BaseRestTest
|
|||||||
|
|
||||||
// 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
|
||||||
@@ -321,8 +329,15 @@ public class NonElectronicRecordTests extends BaseRestTest
|
|||||||
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
|
||||||
@@ -343,8 +358,9 @@ public class NonElectronicRecordTests extends BaseRestTest
|
|||||||
*/
|
*/
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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