@Test
public void namesAreShortened() throws IOException {

    Map<String, File> files = new LinkedHashMap<>();
    File dest = folder.newFolder();
    files.put("[TOTAL_FILESNUMBER]" + repeat("a", 400) + "[TOTAL_FILESNUMBER].pdf", folder.newFile());
    OutputWriterHelper.moveToDirectory(files, dest, ExistingOutputPolicy.SKIP, context);
    assertEquals(1, dest.list().length);
    assertEquals(1, context.notifiableTaskMetadata().taskOutput().size());
    assertThat(context.notifiableTaskMetadata().taskOutput().get(0).getName(), startsWith("1"));
    assertThat(context.notifiableTaskMetadata().taskOutput().get(0).getName(), endsWith("a.pdf"));
    assertThat(context.notifiableTaskMetadata().taskOutput().get(0).getName().length(), is(lessThan(256)));
}