mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-4405: removed hardcoding
This commit is contained in:
@@ -42,6 +42,7 @@ import static org.testng.Assert.fail;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import com.google.common.io.Resources;
|
import com.google.common.io.Resources;
|
||||||
|
import com.jayway.restassured.http.ContentType;
|
||||||
import com.jayway.restassured.response.Response;
|
import com.jayway.restassured.response.Response;
|
||||||
|
|
||||||
import org.alfresco.rest.core.RestAPI;
|
import org.alfresco.rest.core.RestAPI;
|
||||||
@@ -170,8 +171,8 @@ public class FilePlanComponentAPI extends RestAPI<FilePlanComponentAPI>
|
|||||||
UserModel currentUser = usingRestWrapper().getTestUser();
|
UserModel currentUser = usingRestWrapper().getTestUser();
|
||||||
Response response = given()
|
Response response = given()
|
||||||
.auth().basic(currentUser.getUsername(), currentUser.getPassword())
|
.auth().basic(currentUser.getUsername(), currentUser.getPassword())
|
||||||
.multiPart("nodeBodyCreate", toJson(electronicRecordModel), "application/json")
|
.multiPart("nodeBodyCreate", toJson(electronicRecordModel), ContentType.JSON.name())
|
||||||
.multiPart("filedata", recordContent, "application/octet-stream")
|
.multiPart("filedata", recordContent, ContentType.BINARY.name())
|
||||||
.expect()
|
.expect()
|
||||||
.statusCode(HttpStatus.CREATED.value())
|
.statusCode(HttpStatus.CREATED.value())
|
||||||
.when()
|
.when()
|
||||||
|
@@ -11,30 +11,21 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.rest.rm.community.fileplancomponents;
|
package org.alfresco.rest.rm.community.fileplancomponents;
|
||||||
|
|
||||||
import org.testng.annotations.DataProvider;
|
|
||||||
import org.testng.annotations.Test;
|
|
||||||
|
|
||||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS;
|
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.FILE_PLAN_ALIAS;
|
||||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.UNFILED_RECORDS_CONTAINER_ALIAS;
|
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentAlias.UNFILED_RECORDS_CONTAINER_ALIAS;
|
||||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.NON_ELECTRONIC_RECORD_TYPE;
|
|
||||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.RECORD_FOLDER_TYPE;
|
|
||||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.CONTENT_TYPE;
|
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.CONTENT_TYPE;
|
||||||
import static org.alfresco.rest.rm.community.util.PojoUtility.toJson;
|
|
||||||
import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric;
|
import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric;
|
||||||
import static org.springframework.http.HttpStatus.CREATED;
|
import static org.springframework.http.HttpStatus.CREATED;
|
||||||
import static org.testng.Assert.assertFalse;
|
|
||||||
import static org.testng.Assert.assertEquals;
|
|
||||||
import static org.testng.Assert.assertTrue;
|
import static org.testng.Assert.assertTrue;
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
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.model.fileplancomponents.FilePlanComponentProperties;
|
||||||
import org.alfresco.rest.rm.community.requests.FilePlanComponentAPI;
|
import org.alfresco.rest.rm.community.requests.FilePlanComponentAPI;
|
||||||
import org.alfresco.rest.rm.community.requests.RMSiteAPI;
|
|
||||||
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;
|
||||||
|
import org.testng.annotations.DataProvider;
|
||||||
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -49,9 +40,6 @@ public class ElectronicRecordTests extends BaseRestTest
|
|||||||
@Autowired
|
@Autowired
|
||||||
private DataUser dataUser;
|
private DataUser dataUser;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RMSiteAPI rmSiteAPI;
|
|
||||||
|
|
||||||
/** 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";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user