Package org.approvej.scrub
Class Scrubbers
java.lang.Object
org.approvej.scrub.Scrubbers
Collection of static methods to create
Scrubber instances.-
Method Summary
Modifier and TypeMethodDescriptionstatic DateTimeScrubberstatic DateTimeScrubberdateTimeFormat(String dateTimePattern) CreatesDateTimeScrubberto replace date/time strings of the given pattern localized by the defaultLocale.static DateTimeScrubberdateTimeFormat(String dateTimePattern, Locale locale) CreatesDateTimeScrubberto replace date/time strings of the given pattern localized by the given locale.static DateTimeScrubberisoDates()static DateTimeScrubberCreates aDateTimeScrubberfor ISO-8601 date/times, like2019-02-25T12:34:56,2019-02-25T12:34:56.123456789,2019-02-25T12:34:56+02:00, or2019-02-25T12:34:56.123456789+02:00[Europe/Berlin].static DateTimeScrubberisoDateTimes(Locale locale) Creates aDateTimeScrubberfor ISO-8601 date/times, like2019-02-25T12:34:56,2019-02-25T12:34:56.123456789,2019-02-25T12:34:56+02:00, or2019-02-25T12:34:56.123456789+02:00[Europe/Berlin].static DateTimeScrubberCreates aDateTimeScrubberfor ISO-8601 instants, like2019-02-25T12:34:56.123456789+02:00, or2019-02-25T12:34:56.123456789Z.static DateTimeScrubberCreates aDateTimeScrubberfor ISO-8601 local dates, like2019-02-25.static DateTimeScrubberCreates aDateTimeScrubberfor ISO-8601 local date/times, like12:34:56,12:34:56+02:00,12:34:56.123456789, or12:34:56.123456789+02:00.static DateTimeScrubberstatic DateTimeScrubberCreates aDateTimeScrubberfor ISO-8601 offset dates, like2019-02-25+02:00.static DateTimeScrubberCreates aDateTimeScrubberfor ISO-8601 offset date/times, like2019-02-25T12:34:56+02:00, or2019-02-25T12:34:56.123456789+02:00.static DateTimeScrubberCreates aDateTimeScrubberfor ISO-8601 offset times, like12:34:56+02:00, or12:34:56.123456789+02:00.static DateTimeScrubberstatic DateTimeScrubberisoTimes()Creates aDateTimeScrubberfor ISO-8601 times, like12:34:56,12:34:56+02:00,12:34:56.123456789, or12:34:56.123456789+02:00.static DateTimeScrubberstatic DateTimeScrubberCreates aDateTimeScrubberfor ISO-8601 zoned date/times, like2019-02-25T12:34:56+02:00,2019-02-25T12:34:56.123456789+02:00,2019-02-25T12:34:56+02:00[Europe/Berlin], or2019-02-25T12:34:56.123456789+02:00[Europe/Berlin].static DateTimeScrubberisoZonedDateTimes(Locale locale) Creates aDateTimeScrubberfor ISO-8601 zoned date/times, like2019-02-25T12:34:56+02:00,2019-02-25T12:34:56.123456789+02:00,2019-02-25T12:34:56+02:00[Europe/Berlin], or2019-02-25T12:34:56.123456789+02:00[Europe/Berlin].static DateTimeScrubberCreates aDateTimeScrubberfor RFC-1123 date/times, likeMon, 35 Feb 2019 12:34:56 GMT.static RegexScrubberCreates aRegexScrubberfor all given strings.static RegexScrubberstringsMatching(String pattern) Creates aRegexScrubberwith the given pattern.static RegexScrubberstringsMatching(Pattern pattern) Creates aRegexScrubberwith the given pattern.static RegexScrubberuuids()Creates aRegexScrubberfor UUIDs.
-
Method Details
-
strings
Creates aRegexScrubberfor all given strings.This type of
Scrubberis particularly useful if dynamic parts of the value are known. E.g. if they were part of the import parameters of the method under test.- Parameters:
first- the firstStringthat should be scrubbedmore- moreStrings that should be scrubbed- Returns:
- a
RegexScrubberfor all given strings
-
stringsMatching
Creates aRegexScrubberwith the given pattern.- Parameters:
pattern- thePatternmatching the strings to be scrubbed- Returns:
- a
RegexScrubberwith the given pattern
-
stringsMatching
Creates aRegexScrubberwith the given pattern.- Parameters:
pattern- the pattern matching the string to be scrubbed asString- Returns:
- a
RegexScrubberwith the given pattern - See Also:
-
dateTimeFormat
CreatesDateTimeScrubberto replace date/time strings of the given pattern localized by the given locale.- Parameters:
dateTimePattern- a pattern as defined byDateTimeFormatterlocale- theLocaleto localize the date/time pattern (influences names of months or weekdays for example)- Returns:
- a
DateTimeScrubberfor the given date/time pattern - See Also:
-
dateTimeFormat
CreatesDateTimeScrubberto replace date/time strings of the given pattern localized by the defaultLocale.- Parameters:
dateTimePattern- a pattern as defined byDateTimeFormatter- Returns:
- a
DateTimeScrubberfor the given date/time pattern - See Also:
-
isoLocalDates
Creates aDateTimeScrubberfor ISO-8601 local dates, like2019-02-25.- Returns:
- a
DateTimeScrubberfor ISO-8601 local dates - See Also:
-
isoOffsetDates
Creates aDateTimeScrubberfor ISO-8601 offset dates, like2019-02-25+02:00.- Returns:
- a
DateTimeScrubberfor ISO-8601 offset dates - See Also:
-
isoDates
- Returns:
- a
DateTimeScrubberfor ISO-8601 dates - See Also:
-
isoLocalTimes
- Returns:
- a
DateTimeScrubberfor ISO-8601 local times - See Also:
-
isoOffsetTimes
Creates aDateTimeScrubberfor ISO-8601 offset times, like12:34:56+02:00, or12:34:56.123456789+02:00.- Returns:
- a
DateTimeScrubberfor ISO-8601 offset times - See Also:
-
isoTimes
Creates aDateTimeScrubberfor ISO-8601 times, like12:34:56,12:34:56+02:00,12:34:56.123456789, or12:34:56.123456789+02:00.- Returns:
- a
DateTimeScrubberfor ISO-8601 times - See Also:
-
isoLocalDateTimes
Creates aDateTimeScrubberfor ISO-8601 local date/times, like12:34:56,12:34:56+02:00,12:34:56.123456789, or12:34:56.123456789+02:00.- Returns:
- a
DateTimeScrubberfor ISO-8601 local date/times - See Also:
-
isoOffsetDateTimes
Creates aDateTimeScrubberfor ISO-8601 offset date/times, like2019-02-25T12:34:56+02:00, or2019-02-25T12:34:56.123456789+02:00.- Returns:
- a
DateTimeScrubberfor ISO-8601 offset date/times - See Also:
-
isoZonedDateTimes
Creates aDateTimeScrubberfor ISO-8601 zoned date/times, like2019-02-25T12:34:56+02:00,2019-02-25T12:34:56.123456789+02:00,2019-02-25T12:34:56+02:00[Europe/Berlin], or2019-02-25T12:34:56.123456789+02:00[Europe/Berlin].- Parameters:
locale- theLocaleto localize the date/time pattern (influences names for zones codes)- Returns:
- a
DateTimeScrubberfor ISO-8601 zoned date/times - See Also:
-
isoZonedDateTimes
Creates aDateTimeScrubberfor ISO-8601 zoned date/times, like2019-02-25T12:34:56+02:00,2019-02-25T12:34:56.123456789+02:00,2019-02-25T12:34:56+02:00[Europe/Berlin], or2019-02-25T12:34:56.123456789+02:00[Europe/Berlin].- Returns:
- a
DateTimeScrubberfor ISO-8601 zoned date/times - See Also:
-
isoDateTimes
Creates aDateTimeScrubberfor ISO-8601 date/times, like2019-02-25T12:34:56,2019-02-25T12:34:56.123456789,2019-02-25T12:34:56+02:00, or2019-02-25T12:34:56.123456789+02:00[Europe/Berlin].- Parameters:
locale- theLocaleto localize the date/time pattern (influences names for zones codes)- Returns:
- a
DateTimeScrubberfor ISO-8601 date/times - See Also:
-
isoDateTimes
Creates aDateTimeScrubberfor ISO-8601 date/times, like2019-02-25T12:34:56,2019-02-25T12:34:56.123456789,2019-02-25T12:34:56+02:00, or2019-02-25T12:34:56.123456789+02:00[Europe/Berlin].- Returns:
- a
DateTimeScrubberfor ISO-8601 date/times - See Also:
-
isoOrdinalDates
- Returns:
- a
DateTimeScrubberfor ISO-8601 ordinal dates - See Also:
-
isoWeekDates
- Returns:
- a
DateTimeScrubberfor ISO-8601 week dates - See Also:
-
isoInstants
Creates aDateTimeScrubberfor ISO-8601 instants, like2019-02-25T12:34:56.123456789+02:00, or2019-02-25T12:34:56.123456789Z.- Returns:
- a
DateTimeScrubberfor ISO-8601 instants - See Also:
-
basicIsoDates
- Returns:
- a
DateTimeScrubberfor basic ISO-8601 dates - See Also:
-
rfc1123DateTimes
Creates aDateTimeScrubberfor RFC-1123 date/times, likeMon, 35 Feb 2019 12:34:56 GMT. Note that this always uses theLocale.US.- Returns:
- a
DateTimeScrubberfor RFC-1123 date/times - See Also:
-
uuids
Creates aRegexScrubberfor UUIDs.- Returns:
- a
RegexScrubberthat replaces all UUIDs
-