@Test public void testComplexProcess() { String prefix = "prefix_[CURRENTPAGE]_[BASENAME]"; String expected = "prefix_5_[BASENAME]"; assertEquals(expected, victim.process(prefix, nameRequest().page(page))); }
@Override public String process(String inputPrefix, NameGenerationRequest request) { String retVal = ""; if (request != null && request.getPage() != null) { retVal = findAndReplace(inputPrefix, request.getPage()); } return StringUtils.isBlank(retVal) ? inputPrefix : retVal; }
CurrentPagePrefixProcessor extends NumberPrefixProcessor { @Override public String process(String inputPrefix, NameGenerationRequest request) { String retVal = ""; if (request != null && request.getPage() != null) { retVal = findAndReplace(inputPrefix, request.getPage()); } return StringUtils.isBlank(retVal) ? inputPrefix : retVal; } }
CurrentPagePrefixProcessor extends NumberPrefixProcessor { @Override public String process(String inputPrefix, NameGenerationRequest request) { String retVal = ""; if (request != null && request.getPage() != null) { retVal = findAndReplace(inputPrefix, request.getPage()); } return StringUtils.isBlank(retVal) ? inputPrefix : retVal; } CurrentPagePrefixProcessor(); }
CurrentPagePrefixProcessor extends NumberPrefixProcessor { @Override public String process(String inputPrefix, NameGenerationRequest request) { String retVal = ""; if (request != null && request.getPage() != null) { retVal = findAndReplace(inputPrefix, request.getPage()); } return StringUtils.isBlank(retVal) ? inputPrefix : retVal; } CurrentPagePrefixProcessor(); @Override String process(String inputPrefix, NameGenerationRequest request); }
CurrentPagePrefixProcessor extends NumberPrefixProcessor { @Override public String process(String inputPrefix, NameGenerationRequest request) { String retVal = ""; if (request != null && request.getPage() != null) { retVal = findAndReplace(inputPrefix, request.getPage()); } return StringUtils.isBlank(retVal) ? inputPrefix : retVal; } CurrentPagePrefixProcessor(); @Override String process(String inputPrefix, NameGenerationRequest request);  }