@Test public void testComplexProcessDoubleSinglePattern() { String prefix = "prefix_[FILENUMBER###]_[FILENUMBER]"; String expected = "prefix_005_5"; assertEquals(expected, victim.process(prefix, nameRequest().fileNumber(fileNumber))); }
@Override public String process(String inputPrefix, NameGenerationRequest request) { String retVal = ""; if (request != null && request.getFileNumber() != null) { retVal = findAndReplace(inputPrefix, request.getFileNumber()); } return StringUtils.isBlank(retVal) ? inputPrefix : retVal; }
FileNumberPrefixProcessor extends NumberPrefixProcessor { @Override public String process(String inputPrefix, NameGenerationRequest request) { String retVal = ""; if (request != null && request.getFileNumber() != null) { retVal = findAndReplace(inputPrefix, request.getFileNumber()); } return StringUtils.isBlank(retVal) ? inputPrefix : retVal; } }
FileNumberPrefixProcessor extends NumberPrefixProcessor { @Override public String process(String inputPrefix, NameGenerationRequest request) { String retVal = ""; if (request != null && request.getFileNumber() != null) { retVal = findAndReplace(inputPrefix, request.getFileNumber()); } return StringUtils.isBlank(retVal) ? inputPrefix : retVal; } FileNumberPrefixProcessor(); }
FileNumberPrefixProcessor extends NumberPrefixProcessor { @Override public String process(String inputPrefix, NameGenerationRequest request) { String retVal = ""; if (request != null && request.getFileNumber() != null) { retVal = findAndReplace(inputPrefix, request.getFileNumber()); } return StringUtils.isBlank(retVal) ? inputPrefix : retVal; } FileNumberPrefixProcessor(); @Override String process(String inputPrefix, NameGenerationRequest request); }
FileNumberPrefixProcessor extends NumberPrefixProcessor { @Override public String process(String inputPrefix, NameGenerationRequest request) { String retVal = ""; if (request != null && request.getFileNumber() != null) { retVal = findAndReplace(inputPrefix, request.getFileNumber()); } return StringUtils.isBlank(retVal) ? inputPrefix : retVal; } FileNumberPrefixProcessor(); @Override String process(String inputPrefix, NameGenerationRequest request);  }