RM-4405: removed hardcoding

This commit is contained in:
Kristijan Conkas
2016-12-07 16:49:02 +00:00
parent e914ce90bd
commit 66bc56afff
2 changed files with 5 additions and 16 deletions

View File

@@ -42,6 +42,7 @@ import static org.testng.Assert.fail;
import java.io.File;
import com.google.common.io.Resources;
import com.jayway.restassured.http.ContentType;
import com.jayway.restassured.response.Response;
import org.alfresco.rest.core.RestAPI;
@@ -170,8 +171,8 @@ public class FilePlanComponentAPI extends RestAPI<FilePlanComponentAPI>
UserModel currentUser = usingRestWrapper().getTestUser();
Response response = given()
.auth().basic(currentUser.getUsername(), currentUser.getPassword())
.multiPart("nodeBodyCreate", toJson(electronicRecordModel), "application/json")
.multiPart("filedata", recordContent, "application/octet-stream")
.multiPart("nodeBodyCreate", toJson(electronicRecordModel), ContentType.JSON.name())
.multiPart("filedata", recordContent, ContentType.BINARY.name())
.expect()
.statusCode(HttpStatus.CREATED.value())
.when()

View File

@@ -11,30 +11,21 @@
*/
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.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.util.PojoUtility.toJson;
import static org.alfresco.utility.data.RandomData.getRandomAlphanumeric;
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 java.util.Random;
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.FilePlanComponentProperties;
import org.alfresco.rest.rm.community.requests.FilePlanComponentAPI;
import org.alfresco.rest.rm.community.requests.RMSiteAPI;
import org.alfresco.utility.data.DataUser;
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
private DataUser dataUser;
@Autowired
private RMSiteAPI rmSiteAPI;
/** image resource file to be used for records body */
private static final String IMAGE_FILE = "money.JPG";