Configuring the test environment
Our strategy for unit testing is to create a set of test cases that can be run in an automated manner at any time during the development lifecycle. "Automated" means that no developer interaction is required; the tests can be run as part of the build process and do not require user input. The entire process is managed seamlessly through the use of Maven, JUnit, and Spring. Maven convention expects a test directory structure under the src
directory with testing resources and Java test cases in subdirectories as shown in the following screenshot:
Note how Maven uses the same directory structure for both source and testing layouts. All resources required to execute test cases will be found in the src/test/resources
directory. Likewise, all the resources required for deployment will be found in the src/main/resources
directory. The "convention over configuration" paradigm once again reduces the number of decisions that the developer needs...