AppendExtensionPrefixProcessor implements PrefixProcessor { @Override public String process(String inputPrefix, NameGenerationRequest request) { if (request != null && StringUtils.isNotBlank(request.getExtension())) { return String.format("%s.%s", inputPrefix, request.getExtension()); } return inputPrefix; }  @Override String process(String inputPrefix, NameGenerationRequest request);  }
@Test public void testProcess() { String prefix = "blabla"; String expected = "blabla.pdf"; assertEquals(expected, victim.process(prefix, nameRequest())); }
@Test public void testProcessNonDefaultExtension() { String prefix = "blabla"; String expected = "blabla.txt"; assertEquals(expected, victim.process(prefix, nameRequest(SejdaFileExtensions.TXT_EXTENSION))); }
@Test public void testProcessNullRequest() { String prefix = "blabla"; assertEquals(prefix, victim.process(prefix, null)); }