Near expiry password feature

Near expiry password feature
Move the shared code between the two test cases out and update the name of the methods based on what it does.