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:
eknizat
2019-07-02 10:13:33 +01:00
committed by GitHub
parent 4da81d99aa
commit 28158ec48b
2 changed files with 31 additions and 4 deletions

View File

@@ -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
{