Outline updated November 2026
Java with Spring Boot: Secure REST APIs
Class Duration
35 hours of live training delivered over 5-10 days to accommodate your scheduling needs
Student Prerequisites
- Good understanding of general programming concepts including object-oriented programming
- Experience with Java is recommended but not required
Target Audience
Software engineers, tech leads, and platform teams who build Java services and need secure, observable, well-tested REST APIs. Teams weighing protocol choices can pair this with API Design: REST, GraphQL, and gRPC. Teams upgrading existing Spring Boot services can add Migrating to Spring Boot 4 with AI Coding Agents.
Description
This course takes engineers from Java basics to secure, tested REST APIs with Spring Boot. Students start with modern Java in VS Code, including records, sealed types, and pattern matching, and build with Maven. They then write Spring Web controllers with validation, Problem Details errors, and built-in API versioning. Later modules cover virtual threads, RestClient, JPA and Hibernate, Spring Security with JWT, logging, and springdoc OpenAPI. The course ends with unit tests in JUnit and Mockito and integration tests with Testcontainers.
Learning Outcomes
- Write and debug modern Java in VS Code.
- Model data with records, sealed types, and pattern matching.
- Design classes with interfaces, inheritance, and encapsulation.
- Build and manage projects with Maven.
- Build REST controllers with Spring Web and Bean Validation.
- Return consistent errors with RFC 9457 Problem Details.
- Handle blocking work with virtual threads.
- Call other services with RestClient and HTTP interface clients.
- Persist data with JPA, Hibernate, and Spring Data repositories.
- Secure endpoints with Spring Security and JWT.
- Document APIs with springdoc OpenAPI and Swagger UI.
- Add structured logging with SLF4J and Logback.
- Test services with JUnit, Mockito, and Testcontainers.
Training Materials
All students receive comprehensive courseware covering all topics in the course. Courseware is distributed via GitHub in the form of documentation and extensive code samples. Students practice the topics covered through challenging hands-on lab exercises.
Software Requirements
Students will need a free, personal GitHub account to access the courseware. Students will need permission to install a JDK (Java 25 LTS recommended; Spring Boot 4 requires Java 17 or later), Maven, Docker or another container runtime for Testcontainers, and Visual Studio Code on their computers. Also, students will need permission to install Maven Packages and Visual Studio Code extensions. If students are unable to configure a local environment, a cloud-based environment can be provided.
Training Topics
Getting Started with Java
- Modern Java and the Java Virtual Machine
- JDK vs. JRE and Java LTS releases
- Building Java apps in VS Code
- Compact source files and instance
mainmethods - Types and variables, including
var - Sequence, selection, and iteration
- Text blocks and string formatting
- Debugging in VS Code
Classes and Objects
- Object-oriented programming
- Defining a class
- Instantiating an object
- Behavior and data
- Constructors
- Getters and setters
- Static members
- Encapsulation
- Inheritance
- Polymorphism
- Implementation vs. contract
- Interfaces
- Abstract classes
Records, Sealed Types, and Pattern Matching
- Records for immutable data and DTOs
- Compact constructors and validation in records
- Sealed classes and interfaces
- Pattern matching for
instanceofandswitch - Record patterns and exhaustive
switch
Maven
- Project structure
- Dependencies
- The POM file
- Build lifecycle
- Plugins
Spring Boot
- Spring Boot and Spring Framework overview
- Auto-configuration
- Modular starter projects
- Embedded server
- Application configuration and profiles
- Null-safety with JSpecify annotations
- Virtual threads for request handling
- Rapid development
Spring Web
- REST endpoints
- Controllers
- Routing
- Request/response model
- Request handling
- Request validation with Bean Validation
- JSON support with records
- Built-in API versioning
Error Handling with Problem Details
- RFC 9457 Problem Details for HTTP APIs
ProblemDetailandErrorResponse- Global exception handling with
@RestControllerAdvice - Validation errors as Problem Details
- Consistent error contracts across services
Calling Other Services
- RestClient fluent API
- Declarative HTTP interface clients with
@HttpExchange - Registering HTTP service clients in groups
- Timeouts, retries, and error handling
- Moving from RestTemplate to RestClient
Connect to a Database
- JPA overview
- Database configuration
- Entity mapping
- Hibernate ORM
- Persistence context
- Repository patterns
- Projections with records
- H2 integration
- In-memory testing
- Schema generation
Logging
- Logging fundamentals
- SLF4J overview
- Logback configuration
- Logging levels
- Structured logging
- Logging in Spring Boot
API Documentation
- OpenAPI overview
- Adding the springdoc dependency
- Auto-generated API documentation
- Swagger UI
- Describing endpoints with annotations
- Documenting versioned APIs and error responses
- Viewing and exporting API specs
Authentication & Authorization
- Security fundamentals
- Introduction to JWT
- Spring Security configuration with the lambda DSL
- Generating and signing tokens
- Validating and parsing tokens
- Securing endpoints
- Role-based authorization
Unit Testing with JUnit
- Testing fundamentals
- JUnit annotations
- Writing test cases
- Assertions
- Testing Spring components
- Mocking with Mockito and
@MockitoBean - Testing endpoints with MockMvc and RestTestClient
- Test organization
Integration Testing with Testcontainers
- Why test against real dependencies
- Testcontainers fundamentals
- PostgreSQL and other services in containers
@ServiceConnectionfor automatic configuration- Reusing containers for fast test suites
- Running container-based tests in CI