mirror of
https://github.com/Alfresco/alfresco-transform-core.git
synced 2025-05-26 17:24:47 +00:00
Merge branch 'feature/ATS-35' into 'master'
ATS-35 : T-Engines: update Docker Transformers to Spring Boot 2.0.x GA See merge request Repository/alfresco-docker-transformers!19
This commit is contained in:
commit
71f0598115
@ -84,14 +84,14 @@ public class LibreOfficeControllerTest extends AbstractTransformerControllerTest
|
||||
|
||||
doAnswer((Answer) invocation ->
|
||||
{
|
||||
File sourceFile = invocation.getArgumentAt(0, File.class);
|
||||
File targetFile = invocation.getArgumentAt(1, File.class);
|
||||
File sourceFile = invocation.getArgument(0);
|
||||
File targetFile = invocation.getArgument(1);
|
||||
String actualTargetExtension = StringUtils.getFilenameExtension(targetFile.getAbsolutePath());
|
||||
|
||||
assertNotNull(sourceFile);
|
||||
assertNotNull(targetFile);
|
||||
|
||||
Long actualTimeout = invocation.getArgumentAt(2, Long.class);
|
||||
Long actualTimeout = invocation.getArgument(2);
|
||||
assertNotNull(actualTimeout);
|
||||
if (expectedTimeout != null)
|
||||
{
|
||||
|
@ -17,6 +17,10 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
@ -30,6 +34,33 @@
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-transform-data-model</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- ATS-71: override mockito & byte-buddy (for JDK 11) -->
|
||||
<!-- Revisit (& remove if possible) when we upgrade Spring Boot Starter Parent (eg. 2.0.5 to 2.1) -->
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-inline</artifactId>
|
||||
<version>2.22.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.bytebuddy</groupId>
|
||||
<artifactId>byte-buddy</artifactId>
|
||||
<version>1.9.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.bytebuddy</groupId>
|
||||
<artifactId>byte-buddy-agent</artifactId>
|
||||
<version>1.9.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -720,22 +720,15 @@ public abstract class AbstractTransformerController
|
||||
|
||||
protected ResponseEntity<Resource> createAttachment(String targetFilename, File targetFile, Long testDelay)
|
||||
{
|
||||
try
|
||||
{
|
||||
Resource targetResource = load(targetFile);
|
||||
targetFilename = UriUtils.encodePath(StringUtils.getFilename(targetFilename), "UTF-8");
|
||||
ResponseEntity<Resource> body = ResponseEntity.ok().header(HttpHeaders.CONTENT_DISPOSITION,
|
||||
"attachment; filename*= UTF-8''" + targetFilename).body(targetResource);
|
||||
LogEntry.setTargetSize(targetFile.length());
|
||||
long time = LogEntry.setStatusCodeAndMessage(200, "Success");
|
||||
time += LogEntry.addDelay(testDelay);
|
||||
getProbeTestTransformInternal().recordTransformTime(time);
|
||||
return body;
|
||||
}
|
||||
catch (UnsupportedEncodingException e)
|
||||
{
|
||||
throw new TransformException(500, "Filename encoding error", e);
|
||||
}
|
||||
Resource targetResource = load(targetFile);
|
||||
targetFilename = UriUtils.encodePath(StringUtils.getFilename(targetFilename), "UTF-8");
|
||||
ResponseEntity<Resource> body = ResponseEntity.ok().header(HttpHeaders.CONTENT_DISPOSITION,
|
||||
"attachment; filename*= UTF-8''" + targetFilename).body(targetResource);
|
||||
LogEntry.setTargetSize(targetFile.length());
|
||||
long time = LogEntry.setStatusCodeAndMessage(200, "Success");
|
||||
time += LogEntry.addDelay(testDelay);
|
||||
getProbeTestTransformInternal().recordTransformTime(time);
|
||||
return body;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -28,12 +28,13 @@ package org.alfresco.transformer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
import org.alfresco.transform.client.model.TransformRequestValidator;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
@Configuration
|
||||
public class WebApplicationConfig extends WebMvcConfigurerAdapter {
|
||||
public class WebApplicationConfig implements WebMvcConfigurer
|
||||
{
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
|
@ -27,7 +27,7 @@ package org.alfresco.transformer;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.context.embedded.LocalServerPort;
|
||||
import org.springframework.boot.web.server.LocalServerPort;
|
||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
||||
import org.springframework.http.*;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
|
@ -138,7 +138,7 @@ public abstract class AbstractTransformerControllerTest
|
||||
{
|
||||
public RuntimeExec.ExecutionResult answer(InvocationOnMock invocation) throws Throwable
|
||||
{
|
||||
Map<String, String> actualProperties = invocation.getArgumentAt(0, Map.class);
|
||||
Map<String, String> actualProperties = invocation.getArgument(0);
|
||||
assertEquals("There should be 3 properties", 3, actualProperties.size());
|
||||
|
||||
String actualOptions = actualProperties.get("options");
|
||||
@ -160,7 +160,7 @@ public abstract class AbstractTransformerControllerTest
|
||||
assertEquals("expectedOptions", expectedOptions, actualOptions);
|
||||
}
|
||||
|
||||
Long actualTimeout = invocation.getArgumentAt(1, Long.class);
|
||||
Long actualTimeout = invocation.getArgument(1);
|
||||
assertNotNull(actualTimeout);
|
||||
if (expectedTimeout != null)
|
||||
{
|
||||
|
11
pom.xml
11
pom.xml
@ -18,7 +18,7 @@
|
||||
<image.tag>latest</image.tag>
|
||||
<dependency.pdfbox.version>2.0.8</dependency.pdfbox.version>
|
||||
<dependency.fabric8.version>3.5.37</dependency.fabric8.version>
|
||||
<dependency.spring-boot.version>1.5.15.RELEASE</dependency.spring-boot.version>
|
||||
<dependency.spring-boot.version>2.0.5.RELEASE</dependency.spring-boot.version>
|
||||
<dependency.alfresco-core.version>7.3</dependency.alfresco-core.version>
|
||||
<dependency.alfresco-data-model.version>8.8</dependency.alfresco-data-model.version>
|
||||
<dependency.alfresco-jodconverter-core.version>3.0.1.1</dependency.alfresco-jodconverter-core.version>
|
||||
@ -98,6 +98,15 @@
|
||||
<version>3.2.6</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- ATS-71: override mockito & byte-buddy (for JDK 11) -->
|
||||
<!-- Revisit (& remove if possible) when we upgrade Spring Boot Starter Parent (eg. 2.0.5 to 2.1) -->
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>2.22.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user