mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-4159 Getting enterprise UI tests to run.
There's still currently an issue because we have two @Autowired @Primary beans of the same type.
This commit is contained in:
@@ -30,6 +30,17 @@
|
|||||||
<descriptionTemplate>${project.parent.parent.basedir}/license/description.ftl</descriptionTemplate>
|
<descriptionTemplate>${project.parent.parent.basedir}/license/description.ftl</descriptionTemplate>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>test-jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
@@ -50,4 +50,19 @@ public class RMRestWrapper extends RestWrapper
|
|||||||
{
|
{
|
||||||
return new RestIGCoreAPI(this, rmRestProperties);
|
return new RestIGCoreAPI(this, rmRestProperties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> T processModel(Class<T> classz, RestRequest restRequest)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return super.processModel(classz, restRequest);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
// TODO Hopefully remove this check when TAS stops using checked exceptions.
|
||||||
|
// See https://gitlab.alfresco.com/tas/alfresco-tas-restapi-test/merge_requests/392
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -26,6 +26,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.rest.core;
|
package org.alfresco.rest.core;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
import org.alfresco.rest.rm.community.requests.igCoreAPI.FilePlanComponentAPI;
|
import org.alfresco.rest.rm.community.requests.igCoreAPI.FilePlanComponentAPI;
|
||||||
import org.alfresco.rest.rm.community.requests.igCoreAPI.FilesAPI;
|
import org.alfresco.rest.rm.community.requests.igCoreAPI.FilesAPI;
|
||||||
import org.alfresco.rest.rm.community.requests.igCoreAPI.RMSiteAPI;
|
import org.alfresco.rest.rm.community.requests.igCoreAPI.RMSiteAPI;
|
||||||
@@ -50,7 +52,7 @@ public class RestAPIFactory
|
|||||||
@Autowired
|
@Autowired
|
||||||
private DataUser dataUser;
|
private DataUser dataUser;
|
||||||
|
|
||||||
@Autowired
|
@Resource(name = "RMRestWrapper")
|
||||||
private RMRestWrapper rmRestWrapper;
|
private RMRestWrapper rmRestWrapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -96,7 +98,7 @@ public class RestAPIFactory
|
|||||||
{
|
{
|
||||||
return getRestIGCoreAPI(userModel).usingRecords();
|
return getRestIGCoreAPI(userModel).usingRecords();
|
||||||
}
|
}
|
||||||
|
|
||||||
public FilesAPI getFilesAPI()
|
public FilesAPI getFilesAPI()
|
||||||
{
|
{
|
||||||
return getRestIGCoreAPI(null).usingFiles();
|
return getRestIGCoreAPI(null).usingFiles();
|
||||||
|
@@ -28,7 +28,6 @@ package org.alfresco.rest.rm.community.requests.igCoreAPI;
|
|||||||
|
|
||||||
import static com.jayway.restassured.RestAssured.basic;
|
import static com.jayway.restassured.RestAssured.basic;
|
||||||
import static com.jayway.restassured.RestAssured.given;
|
import static com.jayway.restassured.RestAssured.given;
|
||||||
|
|
||||||
import static org.alfresco.rest.core.RestRequest.requestWithBody;
|
import static org.alfresco.rest.core.RestRequest.requestWithBody;
|
||||||
import static org.alfresco.rest.core.RestRequest.simpleRequest;
|
import static org.alfresco.rest.core.RestRequest.simpleRequest;
|
||||||
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.CONTENT_TYPE;
|
import static org.alfresco.rest.rm.community.model.fileplancomponents.FilePlanComponentType.CONTENT_TYPE;
|
||||||
|
@@ -65,7 +65,7 @@ public class FilesAPI extends RMModelRequest
|
|||||||
public FilePlanComponent declareAsRecord(String fileId, String parameters) throws Exception
|
public FilePlanComponent declareAsRecord(String fileId, String parameters) throws Exception
|
||||||
{
|
{
|
||||||
mandatoryString("fileId", fileId);
|
mandatoryString("fileId", fileId);
|
||||||
|
|
||||||
return getRMRestWrapper().processModel(FilePlanComponent.class, simpleRequest(
|
return getRMRestWrapper().processModel(FilePlanComponent.class, simpleRequest(
|
||||||
POST,
|
POST,
|
||||||
"/files/{fileId}/declare?{parameters}",
|
"/files/{fileId}/declare?{parameters}",
|
||||||
@@ -73,7 +73,7 @@ public class FilesAPI extends RMModelRequest
|
|||||||
parameters
|
parameters
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A no-parameter version of {@link FilesAPI#declareAsRecord}
|
* A no-parameter version of {@link FilesAPI#declareAsRecord}
|
||||||
* @param fileId The Id of a file to declare as record
|
* @param fileId The Id of a file to declare as record
|
||||||
|
@@ -27,7 +27,6 @@
|
|||||||
package org.alfresco.rest.rm.community.requests.igCoreAPI;
|
package org.alfresco.rest.rm.community.requests.igCoreAPI;
|
||||||
|
|
||||||
import static com.jayway.restassured.RestAssured.given;
|
import static com.jayway.restassured.RestAssured.given;
|
||||||
|
|
||||||
import static org.alfresco.rest.core.RestRequest.requestWithBody;
|
import static org.alfresco.rest.core.RestRequest.requestWithBody;
|
||||||
import static org.alfresco.rest.rm.community.util.ParameterCheck.mandatoryObject;
|
import static org.alfresco.rest.rm.community.util.ParameterCheck.mandatoryObject;
|
||||||
import static org.alfresco.rest.rm.community.util.ParameterCheck.mandatoryString;
|
import static org.alfresco.rest.rm.community.util.ParameterCheck.mandatoryString;
|
||||||
|
@@ -30,7 +30,6 @@ import java.io.IOException;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||||
import com.fasterxml.jackson.core.JsonGenerationException;
|
import com.fasterxml.jackson.core.JsonGenerationException;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
||||||
import com.fasterxml.jackson.databind.JsonMappingException;
|
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
@@ -46,9 +45,8 @@ public class PojoUtility
|
|||||||
* Converting object to JSON string
|
* Converting object to JSON string
|
||||||
*
|
*
|
||||||
* @param model The java object model to convert
|
* @param model The java object model to convert
|
||||||
* @throws JsonProcessingException Throws exceptions if the given object doesn't match to the POJO class model
|
|
||||||
*/
|
*/
|
||||||
public static String toJson(Object model) throws JsonProcessingException
|
public static String toJson(Object model)
|
||||||
{
|
{
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
//include only values that differ from default settings to be included
|
//include only values that differ from default settings to be included
|
||||||
|
Reference in New Issue
Block a user