-
Notifications
You must be signed in to change notification settings - Fork 0
JUnit Testing
HowardYaw edited this page Nov 5, 2020
·
4 revisions
Test Directory: src/test/
Integration Test is used and expected to be create in each feature branch
- Create a file with the controller naming if the test file is not exists
(Eg: AccountResourceIT) - Create Test with consistent and clear naming [ activity_{condition:opt}_{expected:opt} ]
(Eg: createUser_WithEmailExists_ShouldThrow400) - Execute the test on local and make sure it success before commit and push
To run all tests on your local machine:
mvn clean
mvn clean verify
This is to make the testing of application done with one click in Intellij
In Configuration Tab:
- Test kind:
- All in package
- Package:
- com.thirdcc.webapp
- Search for tests:
- In whole project
- Before Launch:
- Add RunMavenGoal with command
cleanbefore build
- Add RunMavenGoal with command
- Shorten Command Line:
- Select
classpath file
- Select
In Code Coverage tab:
- Add packages and classes to record coverage:
- web
- service
- repository
- Select the configuration
- Click on Run with Coverage button (Third button usually)