mirror of
https://github.com/Alfresco/alfresco-transform-core.git
synced 2025-08-14 17:58:27 +00:00
ACS-2497 Rework httpTransformRequestUsingDirectAccessUrlTest so it can be used in AI and Aspose (#535)
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
<div>
|
||||
<br/>
|
||||
<a href="/">Test Transformation</a>
|
||||
<a href="/transform/config?configVersion=9999">Transformer Config</a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
@@ -27,6 +27,7 @@
|
||||
package org.alfresco.transformer;
|
||||
|
||||
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
|
||||
import static org.alfresco.transform.client.model.Mimetype.MIMETYPE_TEXT_PLAIN;
|
||||
import static org.alfresco.transform.client.util.RequestParamMap.DIRECT_ACCESS_URL;
|
||||
import static org.alfresco.transform.client.util.RequestParamMap.ENDPOINT_TRANSFORM;
|
||||
import static org.alfresco.transform.client.util.RequestParamMap.ENDPOINT_TRANSFORM_CONFIG_LATEST;
|
||||
@@ -86,6 +87,7 @@ import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.test.util.ReflectionTestUtils;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.ResultActions;
|
||||
import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
|
||||
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
|
||||
|
||||
@@ -655,9 +657,15 @@ public abstract class AbstractTransformerControllerTest
|
||||
File dauSourceFile = getTestFile("quick." + sourceExtension, true);
|
||||
String directUrl = "file://" + dauSourceFile.toPath();
|
||||
|
||||
mockMvc.perform(
|
||||
mockMvcRequest("/transform", null, "targetExtension", targetExtension, DIRECT_ACCESS_URL, directUrl))
|
||||
.andExpect(status().is(OK.value()))
|
||||
.andExpect(content().bytes(expectedTargetFileBytes));
|
||||
ResultActions resultActions = mockMvc.perform(
|
||||
mockMvcRequest(ENDPOINT_TRANSFORM, null)
|
||||
.param("targetExtension", targetExtension)
|
||||
.param(DIRECT_ACCESS_URL, directUrl))
|
||||
.andExpect(status().is(OK.value()));
|
||||
|
||||
if (expectedTargetFileBytes != null)
|
||||
{
|
||||
resultActions.andExpect(content().bytes(expectedTargetFileBytes));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user