You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Paul Hammant edited this page Jul 20, 2019
·
3 revisions
Specifically, changing, redacting, and all that.
new MarkdownRecorder()
.withReplacementInRecording("'password': '.*'",
"'password': 'REDACTED_PASSWORD'")
.withReplacementInRecording("'date': '.*'",
"'date': 'TODAYS_DATE_CCYY-MM-DD'")
In this case we're wanting to replace password and date in the recording. Password, as each team member might have a password for the "real" down-stack service, and the team has a policy of not sharing passwords/secrets, which means they don't do into source control. Date, as the intent of a recording is that it is viable for reliable replay for multiple days if not weeks. Whereas you may leave the password in it's redacted form, the date might need to be real in a response body. It would needs to be changed back to something like 2019-08-16, and we can programmatically perform that:
new MarkdownReplayer()
.withReplacementInPlayback("'date': 'TODAYS_DATE_CCYY-MM-DD'",
"'date': '" + todaysDateInCCYYMMDDfmt() + "'")