Property files

Using property files in development is fairly common and simple to do. In some development environments, actual confirmation and exception messages are stored in confirmation.properties and exception.properties files. In those files, there is usually a code=message pairing for each type of message and those are pulled on the fly when specific actions are performed in the application. Dynamic data can be stuffed into them also by using a placeholder in the file. The same model can be used in testing them.

So, instead of storing the confirmation and exception messages in the test data, create two files to store them in and pass in the corresponding code to the test method:

// confirmation.properties
001=User account was successfully created
002=We have sent a password reset email to {EMAIL}.
003=You have successfully signed out.
004=Password was successfully updated.
005=Successfully deleted user {USER}.

// exception.properties
001=Please provide a valid email address
002=Couldn't find your Google Account
003=Please provide a password
004=Your account has been locked due to too many invalid login attempts.
005=User account {USER} Not Recognized.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.180.244