@Test public void sanitizeValueShouldReturnSameIfNothingToReplace() { TextValueCleaner textValueCleaner = new TextValueCleaner(); String cleanedValue = textValueCleaner.sanitizeValue("abc"); assertEquals("abc", cleanedValue); }
public String sanitizeValue(@Nullable String value) { String cleanValue = value; if (cleanValue != null) { cleanValue = cleanValue.trim(); cleanValue = cleanValue.replace(NEWLINE, SPACE); cleanValue = cleanValue.replace(TAB, SPACE); } return cleanValue; }
TextValueCleaner { public String sanitizeValue(@Nullable String value) { String cleanValue = value; if (cleanValue != null) { cleanValue = cleanValue.trim(); cleanValue = cleanValue.replace(NEWLINE, SPACE); cleanValue = cleanValue.replace(TAB, SPACE); } return cleanValue; } }
TextValueCleaner { public String sanitizeValue(@Nullable String value) { String cleanValue = value; if (cleanValue != null) { cleanValue = cleanValue.trim(); cleanValue = cleanValue.replace(NEWLINE, SPACE); cleanValue = cleanValue.replace(TAB, SPACE); } return cleanValue; } @Inject  TextValueCleaner(); }
TextValueCleaner { public String sanitizeValue(@Nullable String value) { String cleanValue = value; if (cleanValue != null) { cleanValue = cleanValue.trim(); cleanValue = cleanValue.replace(NEWLINE, SPACE); cleanValue = cleanValue.replace(TAB, SPACE); } return cleanValue; } @Inject  TextValueCleaner(); String cleanVal(@Nullable String value); String sanitizeValue(@Nullable String value); }
TextValueCleaner { public String sanitizeValue(@Nullable String value) { String cleanValue = value; if (cleanValue != null) { cleanValue = cleanValue.trim(); cleanValue = cleanValue.replace(NEWLINE, SPACE); cleanValue = cleanValue.replace(TAB, SPACE); } return cleanValue; } @Inject  TextValueCleaner(); String cleanVal(@Nullable String value); String sanitizeValue(@Nullable String value);  }