Build RESTFUL APIs using Kotlin and Spring Boot
Kotlin is the Modern, concise and safe programming language and is one of the popular JVM language in this day and age. It’s also interoperable with Java and other languages, and provides many ways to reuse code between multiple platforms for productive programming. This course will focus on using Kotlin for Server-Side Development using SpringBoot framework. This is a pure hands-on oriented course which covers these two topics:
More
Covers Kotlin Fundamentals thats necessary for Java Developers
Build RestFul APIs using SpringBoot and Kotlin
Section 1: Getting Started With the Course
This section covers the course objectives and the prerequisites that are needed to make the most out of this course.
Section 2: Getting Started with Kotlin Programming Language
In this section, I will introduce you to Kotlin Programming Language and why its a powerful language for enterprise development.
Introduction to Kotlin
How Kotlin Works with the JVM?
Section 3: Kotlin Fundamentals
In this section, we will explore the fundamentals of Kotlin.
val & var variables in Kotlin
Basic Types - Int, Long, Double, String
Conditionals - If and when block
Ranges , Loops
while & do-While
break, labels and return
Section 4: Functions in Kotlin
In this section, we will learn about functions in Kotlin and different ways of declaring and using them
Defining and Invoking Functions
Default Value Parameters & Named Arguments
Top-Level Functions and Top-level Properties
Section 5: Classes, Interfaces and Inheritance
In this section, we will learn about classes, inheritance and interfaces in detail.
Introduction to class - Creating a class and objects
Primary Constructors
Secondary Constructors
initializer code using init block
Data Classes
Custom Getters and Setters
Inheritance - Extending Classes
Inheritance - Override Functions, Variables
object keyword for creating instance of the class
companion object Keyword
Interfaces
Interfaces - Handling Conflicting Functions
Interfaces - Defining and Overrding Variables
Visibility Modifiers
Type Checking, Casting and Smart Cast
Enum class
Section 6: Nulls in Kotlin
In this section, we will learn about handling nulls in Kotlin
Nullable & Non-Nullable types in Kotlin
Safe Call(?) , Elvis Operator(?:) & Non Null Assertion(!!) to deal with Null Values
Invoking or assigning a Nullable Type to a Non-Nullable Type
Section 7: Collections, Arrays & Lamda Expressions
In this section, I will introduce you to collections, arrays and lambda expressions in Kotlin
Introduction to Collections
Introduction to Lamda Expressions
Lambdas and Higher Order Functions
Filter Operations on Kotlin Collections
Map Operations on Kotlin Collections
FlatMap Operations in Collections
Working With HashMaps
Lazy Evaluation of Collections using Sequences
Nullability in Collections
Section 8 : Exceptions In Kotlin
In this section, I will cover the exceptions in kotlin and the techniques to handle them.
Handling Exceptions using try-catch
Section 9 : Scope Functions
In this section, I will introduce you all to scope functions in Kotlin and its usage.
Introduction to Scope Functions
apply & also Scope Function
let Scope Function
with & run Scope Function
Section 10 : Getting Started with Kotlin and Spring Boot
In this section, I will explain the overview of the app we are going to build and build a very simple API.
Overview of the app & Project Setup
Build a Simple Endpoint - Greeting Controller
Constructor Injection in Spring
Setting up different profiles in Spring Boot
Set up Logging in Kotlin
Section 11 : Integration/Unit Testing using Junit 5
In this section, I will code and explain about the techniques to write different types of test cases using spring boot and Kotlin.
Introduction to Automated Tests & Setting up JUnit5
Integration Test for Controller
Unit Test for Controller - Using the Mockk Mocking library
Section 12 : Build the Course Catalog Service
In this section, we will build the Course Catalog Service to manage the Courses
Set up the Course Entity & CourseDTO
Create CourseRepository & Configure JPA in application.yml file
Build the POST Endpoint for adding new Course I
ntegration test for the POST endpoint using JUnit5
Build the Get Endpoint to retrieve all Courses
Integration test for the GET endpoint to retrieve all the courses
Build the Update Endpoint to update a Course
Integration test for the PUT endpoint using JUnit5
Build the DELETE endpoint to delete a Course
Section 13: Unit Testing Controller layer (Web Tier)
In this section, we will code and learn about how to write unit tests for the controller
Setting up the Unit Test for the CourseController
Unit test for the Post Endpoint in CourseController
Unit test for the GET Endpoint in CourseController
Unit test for the PUT Endpoint in CourseController
Unit test for the DELETE Endpoint in CourseController
Section 14 : Bean Validation using Validators and ControllerAdvice
In this section, we will code and learn the different techniques to apply bean validations and handle exceptions using the ControllerAdvice Pattern
Name and Category as Mandatory using @NotBlank Annotation
Implement Custom Error Handling using ControllerAdvice pattern
Handle Global RuntimeException using ControllerAdvice Pattern
Section 15 : Custom JPA queries using Spring Data JPA and DB Layer testing using @DataJpaTest
In this lecture, we will learn about the techniques to write custom JPA queries and the techniques to test the DB layer using the DataJpaTest
Retrieve Courses By Name using JPA Query Creation Function
Retrieve Courses By Name using Native SQL query
Testing Mutliple sets of Data using @Parameterized test
Section 16: GET Endpoint to retrieve Courses By Name using @RequestParam
In this section, we will code and learn about the usage of RequestParam in the controller endpoint.
Use existing GET endpoint to retrieve Courses by Name
Write Integration test to retrieve course by Name
Section 17 : Entity RelationShips using Spring Data JPA
In this section, I will explain the technique to express the relationships in JPA using Entity and Data classes in Kotlin
Adding Instructor Entity in to the Course Catalog Service
Adding the relationship in the Entity Class
Instructor Controller to Manage Instructor Data
Update CourseService to validate Instructor Data
Fix the CourseController Integration Tests
Fix the CourseController Unit Tests
Section 18 : Integrating with Postgres DB
In this section, we will code and learn to integrate the postgres DB in to the course catalog service.
Setting up the Postgres DB and App to interact with Postgres
Test the app with Postgres DB
Section 19 : Integration Testing using TestContainers
In this section, we will code and learn to integrate the testcontainers to run integration test.
Setting Up TestContainers for the Integration Test
Configure @DataJpaTest with TestContainers
Section 20 : Java & Kotlin Interoperability
In this section, we will code and learn about the interoperability between Java and Kotlin.
Invoking Kotlin Code from Java Class
Invoking Java Code from Kotlin
Useful JVM annotations in Kotlin
By the end of this course, you will be comfortable writing code using the Koltin Programming language and Build RestFuL APIs using SpringBoot and Kotlin.
Watch Online Build RESTFUL APIs using Kotlin and Spring Boot
# | Title | Duration |
---|---|---|
1 | Course Introduction | 02:29 |
2 | Prerequisites | 00:51 |
3 | Introduction to Kotlin | 05:23 |
4 | How Kotlin Works with the JVM? | 01:39 |
5 | Project Setup | 02:53 |
6 | Hello Kotlin! | 03:26 |
7 | val & var variables in Kotlin | 04:39 |
8 | Basic Types - Int, Long, Double, String | 06:24 |
9 | Conditionals - If and when block | 07:41 |
10 | Ranges & Loops | 03:31 |
11 | while & do-While | 03:41 |
12 | break, labels and return | 06:31 |
13 | Defining and Invoking Functions | 07:52 |
14 | Default Value Parameters & Named Arguments | 07:25 |
15 | Top-Level Functions and Top-level Properties | 05:24 |
16 | Introduction to class - Creating a class and objects | 02:50 |
17 | Primary Constructors | 03:53 |
18 | Secondary Constructors | 07:44 |
19 | initializer code using init block | 02:40 |
20 | Data Classes | 07:37 |
21 | Custom Getters and Setters | 05:38 |
22 | Inheritance - Extending Classes | 05:56 |
23 | Inheritance - Override Functions, Variables | 04:12 |
24 | object keyword for creating instance of the class | 03:30 |
25 | companion object Keyword | 03:30 |
26 | Interfaces | 09:33 |
27 | Interfaces - Handling Conflicting Functions | 02:49 |
28 | Interfaces - Defining and Overrding Variables | 03:01 |
29 | Visibility Modifiers | 04:37 |
30 | Type Checking, Casting and Smart Cast | 07:17 |
31 | Enum class | 02:11 |
32 | Nullable & Non-Nullable types in Kotlin | 06:19 |
33 | Safe Call(?) ,Elvis Operator(?:),Non Null Assertion(!!) to deal with Null Values | 08:42 |
34 | Invoking or assigning a Nullable Type to a Non-Nullable Type | 03:41 |
35 | Introduction to Collections | 10:22 |
36 | Introduction to Lamda Expressions | 07:32 |
37 | Lambdas and Higher Order Functions | 06:19 |
38 | Filter Operations on Kotlin Collections | 10:14 |
39 | Map Operations on Kotlin Collections | 06:30 |
40 | FlatMap Operations in Collections | 09:50 |
41 | Working With HashMaps | 08:18 |
42 | Lazy Evaluation of Collections using Sequences | 10:35 |
43 | Nullability in Collections | 03:46 |
44 | Handling Exceptions using try-catch | 06:57 |
45 | Introduction to Scope Functions | 04:22 |
46 | apply & also Scope Function | 07:19 |
47 | let Scope Function | 06:23 |
48 | with & run Scope Function | 09:15 |
49 | Overview of the app & Project Setup | 05:24 |
50 | Build a Simple Endpoint - Greeting Controller | 04:03 |
51 | Constructor Injection in Spring | 02:59 |
52 | Setting up different profiles in Spring Boot | 08:47 |
53 | Set up Logging in Kotlin | 03:16 |
54 | Introduction to Automated Tests & Setting up JUnit5 | 05:50 |
55 | Integration Test for Controller | 07:58 |
56 | Unit Test for Controller - Using the Mockk Mocking library | 05:31 |
57 | Set up the Course Entity & CourseDTO | 04:37 |
58 | Create CourseRepository & Configure JPA in application.yml file | 06:58 |
59 | Build the POST Endpoint for adding new Course | 09:48 |
60 | Integration test for the POST endpoint using JUnit5 | 05:50 |
61 | Build the Get Endpoint to retrieve all Courses | 03:07 |
62 | Integration test for the GET endpoint to retrieve all the courses | 06:19 |
63 | Build the Update Endpoint to update a Course | 10:25 |
64 | Integration test for the PUT endpoint using JUnit5 | 04:26 |
65 | Build the DELETE endpoint to delete a Course | 04:10 |
66 | Setting up the Unit Test for the CourseController | 02:10 |
67 | Unit test for the Post Endpoint in CourseController | 03:28 |
68 | Unit test for the GET Endpoint in CourseController | 02:30 |
69 | Unit test for the PUT Endpoint in CourseController | 03:05 |
70 | Unit test for the DELETE Endpoint in CourseController | 01:49 |
71 | Name and Category as Mandatory using @NotBlank Annotation | 05:08 |
72 | Implement Custom Error Handling using ControllerAdvice pattern | 08:10 |
73 | Handle Global RuntimeException using ControllerAdvice Pattern | 04:27 |
74 | Retrieve Courses By Name using JPA Query Creation Function | 07:16 |
75 | Retrieve Courses By Name using Native SQL query | 02:38 |
76 | Testing Mutliple sets of Data using @Parameterized test | 05:35 |
77 | Use existing GET endpoint to retrieve Courses by Name | 02:58 |
78 | Write Integration test to retrieve course by Name | 02:49 |
79 | Adding Instructor Entity in to the Course Catalog Service | 02:33 |
80 | Adding the relationship in the Entity Class | 05:56 |
81 | Instructor Controller to Manage Instructor Data | 05:28 |
82 | Update CourseService to validate Instructor Data | 10:19 |
83 | Fix the CourseController Integration Tests | 05:45 |
84 | Fix the CourseController Unit Tests | 01:11 |
85 | Setting up the Postgres DB and App to interact with Postgres | 07:41 |
86 | Test the app with Postgres DB | 07:52 |
87 | Setting Up TestContainers for the Integration Test | 09:03 |
88 | Configure @DataJpaTest with TestContainers | 04:24 |
89 | Invoking Kotlin Code from Java Class | 03:47 |
90 | Invoking Java Code from Kotlin | 04:05 |
91 | Useful JVM annotations in Kotlin | 10:32 |