ATS-702 Add AIO tests from Misc Transformers (#230)

Add Misc transforms AIO tests
Add Misc IT through AIO
Remove accidental commit.

Co-authored-by: Erik Knizat <erik.knizat@alfresco.com>
Co-authored-by: kristian <kristian.dimitrov@alfresco.com>
Co-authored-by: eknizat <26163420+eknizat@users.noreply.github.com>
This commit is contained in:
David Edwards
2020-04-23 11:05:40 +01:00
committed by GitHub
parent 410997689f
commit b69a17a2a3
9 changed files with 222 additions and 14 deletions

View File

@@ -86,6 +86,18 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

View File

@@ -44,9 +44,9 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.nio.file.Files;
import org.alfresco.transform.client.model.TransformRequest;
import org.alfresco.transformer.transformers.SelectingTransformer;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.text.PDFTextStripper;
import org.junit.Before;
@@ -54,7 +54,6 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.context.annotation.Import;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MvcResult;
@@ -65,13 +64,13 @@ import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilde
public class MiscControllerTest extends AbstractTransformerControllerTest
{
@Autowired
private MiscController controller;
protected AbstractTransformerController controller;
private final String sourceEncoding = "UTF-8";
private final String targetEncoding = "UTF-8";
private final String targetMimetype = MIMETYPE_TEXT_PLAIN;
protected final String sourceEncoding = "UTF-8";
protected final String targetEncoding = "UTF-8";
protected final String targetMimetype = MIMETYPE_TEXT_PLAIN;
private static final String ENGINE_CONFIG_NAME = "misc_engine_config.json";
protected static final String ENGINE_CONFIG_NAME = "misc_engine_config.json";
@Before
public void before() throws Exception
@@ -82,7 +81,7 @@ public class MiscControllerTest extends AbstractTransformerControllerTest
expectedOptions = null;
expectedSourceSuffix = null;
expectedSourceFileBytes = readTestFile(sourceExtension);
expectedTargetFileBytes = readTestFile(targetExtension);
expectedTargetFileBytes = Files.readAllBytes(getTestFile("quick2." + targetExtension, true).toPath());
//expectedTargetFileBytes = null;
sourceFile = new MockMultipartFile("file", "quick." + sourceExtension, sourceMimetype,
expectedSourceFileBytes);