Duration
4 days
Learning Outcomes
After successfully completing this training, the participant should be able to
- Understand what is REST API and how does it work
- Understand differences between SIBS Core and Microservices Architecture
- Use Postman to invoke remote REST API
- Understand REST API standard naming conventions
- Understand Spring Technology Stacks and the advantages using Spring Boot
- Create REST Services with Spring
- Understand what is Java System Properties and Spring Application Configuration
- Configure Tomcat Server Port and Actuator Health Check using Application Configuration
- Logging and configure logging using Application Configuration
- Create and use Spring Component in REST services
- Create, commit and push changes to GitHub repository
- Understand what is OpenAPI specification (OAS) and why does it matter
- Use Springdoc OpenAPI to generate OpenAPI specification for your REST service
- Use Swagger UI to visualize and test your REST API
- Understand what is JUnit test and why does it matter
- Create JUnit test for RestController with WebMvcTest
- Understanding the challenges in service-to-service communication
- Know what is Spring Cloud OpenFeign and Netflix Ribbon
- Create REST client invoking other remote REST API
- Understand what JPA and Hibernate ORM is and why is it important
- Understand what Spring JPA Repository is and why is it important
- Understand what embedded database is and what is the use of it
- Learn how to create an JPA entity for a relational database table with Spring JPA and Hibernate ORM
- Learn how to create a CRUD repository for the relational database table with Spring JPA
- Learn how to audit created and modified records with Spring JPA
- Learn how to use One to One, One to Many and Many to Many JPA entity relationship
- Understand what JPQL is and when to use it
- How to write query for join entities using JPQL and JPA Projection
- What is database migration and Flyway
- Learn how to use Flyway to version control database
- What is Hibernate Validator
- Learn how to perform validation with Hibernate Validator
Target Audience
Target trainee/audience for those with basic Java skill or with C# that has basic experience in using Eclipse, Maven and Git repository for Java development
Day 1
9:00am-10:30am
- What is JSON, HTTP Method, REST API and Web Server
- How does REST API works
- A comparison of SIBS Core with Microservices Architecture
10:30am-10:45pm Morning Break
10:45pm-12:30pm
- Install and explore Postman
- Invoking Postman-Echo REST API with Postman
- REST API Standard Naming Conventions
- What is Spring Boot and what is the advantage of using Spring
- Create a Maven project for Spring REST service
12:30pm-1:30pm Lunch
1:30pm-3:30pm
- What is Spring @RestController Annotation
- Add GET and POST Request Method
- Run and Test your REST service with Postman
- What is a Spring @Component Annotation
3:30pm-3:45pm Afternoon Break
3:45pm-5:00pm
- Inject a Component into your RestController
- Create a GitHub repository
- Commit and push your Spring REST service project to Git repository
- Resolve merge conflict between local and remote Git repository
Day 2
9:00am-10:30am
- What is Java System Properties and Spring Application Configuration
- Configure Tomcat Server Port and Actuator Health Check with Application Configuration
- What is Logging Level
10:30am-10:45pm Morning Break
10:45pm-12:30pm
- Logging in your REST service
- Configure Logging Settings with Application Configuration
- What is OpenAPI specification v3 (OAS3)
- What is Springdoc OpenAPI
12:30pm-1:30pm Lunch
1:30pm-3:30pm
- Adding Springdoc OpenAPI dependency to your Spring REST service
- Using Swagger UI to view and test your REST API
- Viewing OAS definition for your REST service
- What is JUnit test and Sprint Boot Test
- Creating JUnit Test for your REST API using WebMvcTest
- Running your JUnit Tests Manually
3:30pm-3:45pm Afternoon Break
3:45pm-5:00pm
- Running your JUnit Tests with Maven Package
- What is a REST client
- Understanding challenges in service-to-service communication
- What is Spring Cloud OpenFeign and Netflix Ribbon
- Creating a REST Client calling to your REST service
- Creating a JUnit Test for your REST Client
Day 3
9:00am-10:30am
- What is Relational Database
- What is JPA
- What is Hibernate ORM
- What is Spring Data JPA
- Add Spring Boot Starter JPA dependency into existing project
- Create JPA entity class to represent a table
10:30am-10:45pm Morning Break
10:45pm-12:30pm
- Create a CRUD Repository interface for JPA entity
- Using Spring JPA Query Method
- Using CRUD Repository interface in REST Controller
- H2 Database as Embedded In-Memory Database
12:30pm-1:30pm Lunch
1:30pm-3:30pm
- Open H2 Web Console
- What is Spring Data JPA Auditing
- Enable JPA Auditing
- Install PostgreSQL
- Create PostgreSQL Database
3:30pm-3:45pm Afternoon Break
3:45pm-5:00pm
- JDBC URL for Popular Relational Database
- Configure Spring Data JPA to use PostgreSQL Database
- What is Database Migration
- What is Flyway
- Using Flyway to version control database
Day 4
9:00am-10:30am
- What is JPA Entity Relationship
- Create JPA Entity with One to One Relationship
- Create JPA Entity with One to Many Relationship
- Create JPA Entity with Many to Many Relationship
- What is JPQL
10:30am-10:45pm Morning Break
10:45pm-12:30pm
- What is JPA Projection
- Create Query with JPQL and JPA Projection to Join Entities without Relationship
- What is Hibernate Validator
12:30pm-1:30pm Lunch
1:30pm-3:30pm
- Using Validation Annotations
- Field-level Constraint Validator
- Class-level Constraint Validator
3:30pm-3:45pm Afternoon Break
3:45pm-5:00pm
- What is Message Source
- Custom Field-level Constraint Validator
- Custom Class-level Constraint Validator
Programme scope, delivery arrangements and suitability are confirmed during enquiry.