mirror of
https://github.com/Alfresco/alfresco-transform-core.git
synced 2025-09-17 14:21:18 +00:00
REPO-4331: Update target file size check (#66)
* REPO-4331: Transformers should not throw an exception when source and target files are empty
This commit is contained in:
@@ -155,7 +155,7 @@ public class MiscControllerTest extends AbstractTransformerControllerTest
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testStringtoString() throws Exception
|
||||
public void testStringToString() throws Exception
|
||||
{
|
||||
String expected = null;
|
||||
byte[] content = null;
|
||||
@@ -181,6 +181,23 @@ public class MiscControllerTest extends AbstractTransformerControllerTest
|
||||
assertTrue("The content did not include \""+expected, contentResult.contains(expected));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEmptyTextFileReturnsEmptyFile() throws Exception
|
||||
{
|
||||
// Use empty content to create an empty source file
|
||||
byte[] content = new byte[0];
|
||||
|
||||
MvcResult result = sendText("txt",
|
||||
"UTF-8",
|
||||
MIMETYPE_TEXT_PLAIN,
|
||||
"txt",
|
||||
MIMETYPE_TEXT_PLAIN,
|
||||
"UTF-8",
|
||||
content);
|
||||
|
||||
assertEquals("Returned content should be empty for an empty source file", 0, result.getResponse().getContentLength());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void textToPdf() throws Exception
|
||||
{
|
||||
|
Reference in New Issue
Block a user