Save point: [skip ci]

* TestFileInfo -> FileInfo
This commit is contained in:
alandavis
2022-07-21 08:24:31 +01:00
parent 79706f8510
commit 08eaecf4f2
10 changed files with 115 additions and 133 deletions

View File

@@ -168,8 +168,7 @@ public class ProbeTransform
}
// We don't want to be doing test transforms every few seconds, but do want frequent live probes.
public String doTransformOrNothing(HttpServletRequest request, boolean isLiveProbe,
TransformHandler transformHandler)
public String doTransformOrNothing(HttpServletRequest request, boolean isLiveProbe, TransformHandler transformHandler)
{
// If not initialised OR it is a live probe and we are scheduled to to do a test transform.
probeCount++;

View File

@@ -51,9 +51,9 @@ import org.springframework.http.ResponseEntity;
* <p>
* <ul>
* <li>A method providing a
* Stream of test files: {@code public static Stream<TestFileInfo> engineTransformations()}; </li>
* Stream of test files: {@code public static Stream<FileInfo> engineTransformations()}; </li>
* <li> Provide expected json files (&lt;sourceFilename>"_metadata.json") as resources on the classpath.</li>
* <li> Override the method {@code testTransformation(TestFileInfo testFileInfo)} such that it calls
* <li> Override the method {@code testTransformation(FileInfo testFileInfo)} such that it calls
* the super method as a {@code @ParameterizedTest} for example:</li> </ul>
* <pre>
* &#64;ParameterizedTest
@@ -62,10 +62,10 @@ import org.springframework.http.ResponseEntity;
*
* &#64;Override
* public void testTransformation(TestFileInfo testFileInfo)
* public void testTransformation(FileInfo testFileInfo)
*
* {
* super.testTransformation(TestFileInfo testFileInfo)
* super.testTransformation(FileInfo testFileInfo)
* }
* </pre>
*
@@ -82,10 +82,10 @@ public abstract class AbstractMetadataExtractsIT
private final ObjectMapper jsonObjectMapper = new ObjectMapper();
public void testTransformation(TestFileInfo testFileInfo)
public void testTransformation(FileInfo fileInfo)
{
final String sourceMimetype = testFileInfo.getMimeType();
final String sourceFile = testFileInfo.getPath();
final String sourceMimetype = fileInfo.getMimeType();
final String sourceFile = fileInfo.getPath();
final String descriptor = format("Transform ({0}, {1} -> {2}, {3})",
sourceFile, sourceMimetype, targetMimetype, targetExtension);

View File

@@ -29,14 +29,14 @@ package org.alfresco.transform.base;
/**
* @author Cezar Leahu
*/
public class TestFileInfo
public class FileInfo
{
private final String mimeType;
private final String extension;
private final String path;
private final boolean exactMimeType;
public TestFileInfo(final String mimeType, final String extension, final String path,
public FileInfo(final String mimeType, final String extension, final String path,
final boolean exactMimeType)
{
this.mimeType = mimeType;
@@ -65,16 +65,16 @@ public class TestFileInfo
return exactMimeType;
}
public static TestFileInfo testFile(final String mimeType, final String extension,
public static FileInfo testFile(final String mimeType, final String extension,
final String path, final boolean exactMimeType)
{
return new TestFileInfo(mimeType, extension, path, exactMimeType);
return new FileInfo(mimeType, extension, path, exactMimeType);
}
public static TestFileInfo testFile(final String mimeType, final String extension,
public static FileInfo testFile(final String mimeType, final String extension,
final String path)
{
return new TestFileInfo(mimeType, extension, path, false);
return new FileInfo(mimeType, extension, path, false);
}
@Override