-
Spring Initializr
- Gradle
- JDK 11
- Web
- JPA
- H2
- Lombok
-
Find user by email
- User
- Non-final attributes
- Lombok
- UserService
- Tony Stark
- Steve Rogers
- Bruce Banner
- Thor Odinson
- Clinton Barton
- Natasha Romanoff
- UserServiceTest
- User
-
Endpoint to find user by email
- UserController
- Query param
- Run main
- Run with Gradle wrapper
- Postman
- Runtime exception
-
Error handling
- HttpStatusException
- ErrorMessage
- ErrorHandler (RestControllerAdvice, ExceptionHandler)
-
Add more users
- Collection on UserService
- for
- Run test
- Java Stream API (filter, findFirst, Optional)
-
List users by last name
- Add functionality to service
- Test new functionality
-
List user emails by birthday month
- Add birth date to users base
- Stark: 1970-05-29
- Rogers: 1018-07-04
- Banner: 1969-12-18
- Odinson: 1000-01-01
- Barton: 1971-01-07
- Romanoff: 1984-11-22
- Add functionality to service
- Test new functionality
- Add birth date to users base
-
Extract repository
- Return User object only
- Return Stream instead of Collection
-
Apply Spring DI
- Turn service into a component
- Inject service into controller
- Turn repository into a component
- Inject repository into service
- Change test to use Mockito runner
-
Use Spring Data JPA
- Add schema definition on data.sql
- Annotated User entity
- Transform repository to interface
- Remove streams to simplify
- Query by month not supported by query language
- Fix test
- Enable Spring repositories
-
Add basic CRUD to controller
- Update does not override id or email
- Introduce method reference
- Return appropriate status code
- POSTMAN
- User id generate type as IDENTITY
-
Integration Tests
- Add REST-assured to build.gradle