ATS-702 Add AIO tests from Tika (#232)

* ATS-702 - Implement Tika controller tests on AIO

* ATS-702 - Add Tika IT through AIOController
This commit is contained in:
David Edwards
2020-04-22 15:50:20 +01:00
committed by GitHub
parent 88116fc4af
commit cd16637143
7 changed files with 158 additions and 12 deletions

View File

@@ -155,6 +155,18 @@
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-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

@@ -2,7 +2,7 @@
* #%L
* Alfresco Transform Core
* %%
* Copyright (C) 2005 - 2019 Alfresco Software Limited
* Copyright (C) 2005 - 2020 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* -
@@ -88,7 +88,6 @@ import java.util.UUID;
import org.alfresco.transform.client.model.TransformReply;
import org.alfresco.transform.client.model.TransformRequest;
import org.alfresco.transformer.executors.RuntimeExec;
import org.alfresco.transformer.executors.TikaJavaExecutor;
import org.alfresco.transformer.model.FileRefEntity;
import org.alfresco.transformer.model.FileRefResponse;
import org.junit.Before;
@@ -96,8 +95,8 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.stubbing.Answer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.boot.test.mock.mockito.SpyBean;
import org.springframework.core.io.FileSystemResource;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpHeaders;
@@ -134,8 +133,8 @@ public class TikaControllerTest extends AbstractTransformerControllerTest
@Mock
private RuntimeExec mockCheckCommand;
@SpyBean
private TikaController controller;
@Autowired
protected AbstractTransformerController controller;
private String targetEncoding = "UTF-8";
private String targetMimetype = MIMETYPE_TEXT_PLAIN;

View File

@@ -146,9 +146,8 @@ public class TikaTransformationIT
@Test
public void testTransformation()
{
final String descriptor = format("Transform ({0} -> {1}, {2}, sourceMimetype={3})",
sourceFile, targetMimetype, targetExtension, sourceMimetype);
final String descriptor = format("Transform ({0}, {1} -> {2}, {3})",
sourceFile, sourceMimetype, targetMimetype, targetExtension);
try
{
final ResponseEntity<Resource> response = sendTRequest(ENGINE_URL, sourceFile, null,