Spring Boot

How to build a REST API with Spring Boot

Watch the introduction below

This course consists of 18 video lessons (2 hrs) organized into four modules.

Throughout this course, we’ll build a REST API which would save retrieve and delete comments of blog posts.



Lesson 1: Set up the project using Spring Initializr Watch now!

- How to use the spring Initializr to create a project.

- Spring starter dependencies.

- Discuss the content i.e each and every line, of the generated build file.

Lesson 2: Set up the project using Gradle without Spring Initializr Watch now!

- Generate a java project using gradle command line.

- Work on the build file to add the required plugins and dependencies.

- Discuss core Gradle plugins, community plugins and the Gradle plugins portal.

Then generate the eclipse configuration files and import the project to eclipse.


Lesson 3: Design

- What is REST

- Basic REST API Design principles

- Desiging the REST API

- Architecture of a Spring Boot Project

Testing and implementation

This module consists of several lessons on Unit Testing, Implementation and also Integration Testing the API.

Lesson 4: Endpoint implementation to retrieve comments - part 1 (The Controller)

In this lesson, we implement a method to return all comments of a particular post, in a test-first manner.

That means, as, in all of the implementations throughout the project, we write unit tests before writing a single line of logic.

Lesson 5: Endpoint implementation to retrieve comments - part 2 (The Service)

In this lesson, we move the business logic to the service layer by refactoring the controller and unit tests.

Lesson 6: Endpoint implementation to retrieve comments - part 3 (The Repository)

- Spring Data

- How to use the repository interfaces

Lesson 7: Integration testing - part 1

- MockMVC

- Spring’s testing support and annotations

- Request builders

- Result matchers…

Lesson 8: Making a Spring Boot Application Watch now!

This lesson is also a part of the free preview, so if you sign up for the free trial you could check this out.

Here we discuss the spring boot annotations and then add all the required annotations to wire everything up and make the application work.

Lesson 9: Spring Transaction handling

- What does transactional mean in terms of executing a method?

- Overview of how spring transaction management works.

- @Transactional annotation and its settings.

- How to apply transaction management with @Transactional annotation.

- How readOnly applies to transactions.

- Transaction configuration settings.

Lesson 10: Integration testing - part 2

- Here we continue the integration testing

- use JSONPath expressions to assert the response body.

- Preload and clean up the database before and after a test using script files and annotations.

- Return relevant response codes upon exceptions.

Lesson 11: Endpoint implementation to save a comment

Unit tests and implementation of the endpoint for saving a comment.

Lesson 12: Integration testing part 3

Write some integration tests for saving the comment

Lesson 13: End to end test

- Run the application in eclipse

- Save a comment via postman

- Retrieve the saved comment in the browser.

Lesson 14: Endpoint implementation to delete a comment

Unit tests and implementation of the endpoint for deleting a comment. Physical delete vs Logical delete.

Lesson 15: Integration testing part 4

Write some integration tests for deleting the comment


Lesson 16: Deployment

- Various ways of running the application

- War deployment to an external server.

Lesson 17: External Database

- Connect to MySQL server.

- How to use the embedded database for integration testing while using an external database for production.

Each module will also contain text-based lessons on which you would find Links to any external sites and references mentioned in video lessons.


- The link to spring initializer website.

- Gradle commands used in Command-line.

- Other useful information

You would also be able to download the completed project in the last module.