mirror of
https://github.com/Alfresco/alfresco-transform-core.git
synced 2025-08-14 17:58:27 +00:00
Save point: [skip ci]
* aio tests
This commit is contained in:
@@ -149,11 +149,15 @@ public abstract class AbstractBaseTest
|
||||
ReflectionTestUtils.setField(commandExecutor, "checkCommand", origCheckCommand);
|
||||
}
|
||||
|
||||
protected abstract void mockTransformCommand(String sourceExtension,
|
||||
protected void mockTransformCommand(String sourceExtension,
|
||||
String targetExtension, String sourceMimetype,
|
||||
boolean readTargetFileBytes) throws IOException;
|
||||
boolean readTargetFileBytes) throws IOException
|
||||
{
|
||||
}
|
||||
|
||||
protected abstract void updateTransformRequestWithSpecificOptions(TransformRequest transformRequest);
|
||||
protected void updateTransformRequestWithSpecificOptions(TransformRequest transformRequest)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* This method ends up being the core of the mock.
|
||||
|
@@ -91,7 +91,7 @@ public class RestTest
|
||||
parameters.add(DIRECT_ACCESS_URL, "https://expired/direct/access/url");
|
||||
parameters.add(SOURCE_MIMETYPE, MIMETYPE_TEXT_PLAIN);
|
||||
parameters.add(TARGET_MIMETYPE, MIMETYPE_PDF);
|
||||
parameters.add("file", new org.springframework.core.io.ClassPathResource("quick.txt"));
|
||||
parameters.add("file", new org.springframework.core.io.ClassPathResource("original.txt"));
|
||||
|
||||
ResponseEntity<String> response = restTemplate.exchange(ENDPOINT_TRANSFORM, POST,
|
||||
new HttpEntity<>(parameters, HEADERS), String.class, "");
|
||||
@@ -105,7 +105,7 @@ public class RestTest
|
||||
LinkedMultiValueMap<String, Object> parameters = new LinkedMultiValueMap<>();
|
||||
parameters.add(SOURCE_MIMETYPE, MIMETYPE_TEXT_PLAIN);
|
||||
parameters.add(TARGET_MIMETYPE, MIMETYPE_PDF);
|
||||
parameters.add("file", new org.springframework.core.io.ClassPathResource("quick.txt"));
|
||||
parameters.add("file", new org.springframework.core.io.ClassPathResource("original.txt"));
|
||||
|
||||
ResponseEntity<String> response = restTemplate.exchange(ENDPOINT_TRANSFORM, POST,
|
||||
new HttpEntity<>(parameters, HEADERS), String.class, "");
|
||||
|
@@ -40,7 +40,6 @@ import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.MvcResult;
|
||||
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -66,10 +65,8 @@ import static org.alfresco.transform.common.RequestParamMap.TARGET_MIMETYPE;
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.asyncDispatch;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.request;
|
||||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
|
||||
|
||||
/**
|
||||
|
@@ -296,7 +296,7 @@ public class TransformControllerTest
|
||||
@Test
|
||||
public void testTransformEndpointThatUsesTransformRequests() throws Exception
|
||||
{
|
||||
File sourceFile = getTestFile("quick.txt", true, tempDir);
|
||||
File sourceFile = getTestFile("original.txt", true, tempDir);
|
||||
String sourceFileRef = fakeSfsClient.saveFile(sourceFile).getEntry().getFileRef();
|
||||
|
||||
TransformRequest transformRequest = TransformRequest.builder()
|
||||
|
@@ -107,7 +107,7 @@ public class FakeTransformEngineWithTwoCustomTransformers extends AbstractFakeTr
|
||||
@Override
|
||||
public ProbeTransform getProbeTransform()
|
||||
{
|
||||
return new ProbeTransform("quick.txt", MIMETYPE_TEXT_PLAIN, MIMETYPE_PDF,
|
||||
return new ProbeTransform("original.txt", MIMETYPE_TEXT_PLAIN, MIMETYPE_PDF,
|
||||
ImmutableMap.of(SOURCE_ENCODING, "UTF-8"), 46, 0,
|
||||
150, 1024, 1, 60 * 2);
|
||||
}
|
||||
|
@@ -1 +0,0 @@
|
||||
Original Text -> TxT2Pdf()
|
Reference in New Issue
Block a user