How anilappana999/junit5_mockito works
Project type and purpose
• This is a Spring Boot–based backend REST API (no UI) for managing Employee data.
• It’s a learning/demo project focused on showing how to write unit tests (JUnit 5) and mocks (Mockito) in a layered Spring Boot application.
File structure
• Top‐level:
• pom.xml / mvnw*.cmd — Maven build and wrapper scripts
• src/main/java/com/lovetolearn/SpringbootApp — application code
• src/main/resources/application.properties — config (e.g., database settings)
• src/test/java/com/lovetolearn/SpringbootApp — unit and controller tests
• Main packages under src/main/java:
• controller — REST endpoints (EmployeeController)
• service + service/impl — business logic interface/implementation
• dao + dao/impl — data‐access abstractions (optional layer over JPA repo)
• repo — Spring Data JPA repository (EmployeeRepo)
• entities — JPA entities (Employee, ErrorDetails)
• exception — custom exceptions and global exception handler
• Tests:
• EmployeeControllerTest — mock MVC tests
• SpringbootAppApplicationTests — context load tests
Insights from the README
• Purpose: illustrate JUnit 5 + Mockito usage in a real Spring Boot context.
• No additional architectural notes; primary focus is on the layering and testability.
Detail
• Call out interfaces vs. implementations (e.g., EmployeeService → EmployeeServiceImpl).
• JUnit 5 tests invoking controller with mocked service/DAO.