Spring Boot API: Electrical Items Insurance
Table of Contents
- What you will learn
- On completing the learning, you will
- Introduction - Spring Boot Electrical Items Insurance
-
1 AGILE USER STORIES
- What Is a User Story?
- Why Are User Stories Important?
- User Stories and Acceptance Criteria
- How to Write Effective User Stories
- User Stories in Agile Workflows
- Sprint Planning
- Continuous Collaboration
- TDD and BDD Integration
- Examples of User Stories in an Online Insurance System
- User Stories in Gherkin Format
- What is Gherkin?
- The GWT Structure
- Explaining Gherkin with an Insurance Company Example
- Scenario analysis
-
2 QUICK SPRING BOOT SETUP
- Creating a Simple Spring Boot Project
- What is pom.xml?
- Analysis of the pom.xml code sections
- Creating a Basic Controller
- Analysis of the HealthCheckController code
- Analysis of the DemoApplication code
- Creating a Basic Model
- Analysis of the DemoApplication code
- Analysis of the mapping code
- Creating a Basic Service
- Analysis of the mapping code
- Creating a Basic DTO
- What is a DTO?
- Analysis of the QuoteResponseDto?
- Analysis of the calculatequotevaluedto mapping?
- Summarizing our basic API
-
3 TEST-DRIVEN DEVELOPMENT
- JUnit 5 versus JUnit 4
- Creating a Maven Project
- pom.xml
- Product Type Factor Tests
- More Tests
- Product Value Factor Tests
- Calculate Quote Tests
- More robust testing
- Separation of Concerns
- Modularity
- Maintainability
- Testability
- Application of Separation of Concern in Java and Other Languages
- Separation of Concern for the business logic
- Separation of Concern for the tests
- Create a test suite
- Understanding the manifest and jar files
- Configure the project to build a jar file
- Maven configuration (command/script)
- Summary
-
4 SPRING BOOT API – INSURANCE QUOTE BACKEND
- Explanation of common layers
- User Stories
- Project setup
- Starter poms
- The Model Class
- Data Transfer Objects (DTO)
- The Repository Class
- The Service Class
- Create functionality
- Read functionality
- Update functionality
- Delete functionality
- Find record by its id functionality
- RestTemplate
- External Service Client
- The Exception Classes
- The Controller Class
- HTTP responses
- Handling HTTP Requests with Spring's Mapping Annotations
- Adding database functionality
- Configuring the database
- Server Port
- Database setup
- JPA & Hibernate Configuration
- H2 Console Access
- SQL Records
- The Application Class – the main method
- Test the endpoints
- CORS
- HTTP Client in IntelliJ IDEA Ultimate Edition
- Download Postman
- Testing the API with Postman
- The database table
- Derived Queries - (SQL Queries)
- Naming convention
- Supported Keywords
- Basic Derived Query
- Using GreaterThan
- Using LessThan
- Using And
- Using Or
- Using Between
- Using Like
- Using In
- Using OrderBy
- Optional
- Derived queries in the Repository layer
- Derived queries in the Service layer
- Derived queries in the Controller layer
- Why These Endpoints Belong in the Controller
- Test the SQL endpoints
- Quote Calculations as a service
-
5 PRODUCT DESCRIPTION MICROSERVICE
- Creating a Maven Project for the Microservice
- Project setup
- The database table
- Testing the API with Postman
-
6 CUSTOMER MICROSERVICE
- Creating a Maven Project for the Microservice
- Project setup
- Database Records
- The database table
- Testing the API with Postman
- 7 TESTING THE MICROSERVICES INTEGRATION
-
8 PAGINATION AND DYNAMIC SEARCHING
- Pagination with sorting
- Dynamic searching
-
9 VALIDATION
- Layered approach for where and what to validate
- Global Exception handler
- Entity Field Validation
- Controller Method Validation
- Query Parameter Validation
-
10 MOCKING
- Introduction to mocking
- Why We Use Mocking
- Mockito – A Popular Mocking Framework
-
11 LOGGING
- Introduction to logging with SLF4J
- Controller Layer Logging
- Testing the API with Postman
- Testing the API controllers with Postman
- Service Layer Logging
- Testing the API service methods with Postman
- Repository Layer Logging
- Exceptions Layer Logging
-
12 SWAGGER
- Introduction to Swagger
- What is Swagger?
- The Springdoc OpenAPI Dependency
- Compatibility with Spring Boot Versions
- Swagger Integration with our application
- Generated Endpoints and API Documentation
- Documenting our InsuredItem endpoints
- Testing and Interactive Features
- Schema Generation and Validation Documentation
- Advanced Endpoint Documentation
-
13 RESTTEMPLATE AND WEBCLIENT
- RestTemplate - A Classic Approach
- WebClient - A Modern, Reactive Solution
- Analysis of the WebClientConfig code
- Analysis of the ProductClientService code
- Analysis of the CustomerController getProductTypes() code
- Analysis of the ProductClientService code
- Analysis of the CustomerController getProductDescriptionByType() code
- Separate Configuration Class Approach (CustomerMicroservice)
- Main Application Class Approach (InsuredItem Microservice)
-
14 GLOSSARY OF TERMS
- Spring API terms
- WebClient terms