F. Lombok and JUnit Testing
Git Link
1. Lombok
Project Lombok is a java library that automatically plugs into your editor and build tools, spicing up your java. Never write another getter or equals method again, with one annotation your class has a fully featured builder, Automate your logging variables, and much more.- To add lombok on the project, just add the dependency :
After that you can use the lombok's annotations :
- @Data
- @Getter
- @Setter
- @NoArgsConstructor
2. Test dependency (pom.xml)
- JUnit
- Spring data test
- Mockito
3. Configuration and execute test
- Create test package :
- Create the properties file
- Override datasource for unit testing
# spring profile for TEST.spring.profiles.active=test
- Test class
- Testing header
- Just execute the JUnit Test on maven
Comments
Post a Comment