Learn to use Kotlin for server-side development using the Spring Boot framework
About This Video
Learn integration testing DB layer using TestContainers and JUnit5
Learn unit testing function calls using the mock library
Build RESTful services using Spring Boot and Kotlin
In Detail
Kotlin is a modern, concise, and safe programming language and is one of the most popular JVM languages currently. It is also interoperable with Java and …
Build RESTful APIs Using Kotlin and Spring Boot
Video description
Learn to use Kotlin for server-side development using the Spring Boot framework
About This Video
Learn integration testing DB layer using TestContainers and JUnit5
Learn unit testing function calls using the mock library
Build RESTful services using Spring Boot and Kotlin
In Detail
Kotlin is a modern, concise, and safe programming language and is one of the most popular JVM languages currently. It is also interoperable with Java and other languages and provides many ways to reuse code between multiple platforms for productive programming.
Section one covers the course objectives and prerequisites needed to make the most out of this course. In section two, we will be introduced to Kotlin programming language and why it’s a powerful language for enterprise development. Section three is about the fundamentals of Kotlin such as Val and var variables in Kotlin, basic string types, while and do-while, and so on.
Section five is about classes, inheritance, and interfaces in detail, object keywords for creating instances of the class, type checking, casting, and smart cast. In the next section, we will be introduced to collections, arrays, and lambda expressions in Kotlin. We will also understand the scope functions in Kotlin and its usage. Moving on, we will get started with Kotlin and Spring Boot and have an overview of the app we are going to build.
You will also learn to build the course catalog service to manage the courses and to code and learn how to write unit tests for the controller along with coding and learning the usage of RequestParam in the controller endpoint. We will wrap up the course by learning the technique to express relationships in JPA using Entity and data classes in Kotlin.
By the end of this course, you will be comfortable writing code using the Kotlin programming language and building RESTful APIs using Spring Boot and Kotlin.
Audience
This course is for developers who are interested in learning the Kotlin programming language, for developers who are interested in building applications using Kotlin and Spring Boot, and for Java developers who would like to learn the Kotlin programming language. Basic experience working with Java will be an advantage.
Chapter 1 : Getting Started with Kotlin Programming Language
Couse Introduction
Prerequisites
Introduction to Kotlin
How Kotlin Works with the JVM
Chapter 2 : Kotlin Fundamentals
Project Setup
Hello Kotlin!
val and var Variables in Kotlin
Basic Types - Int, Long, Double, String
Conditionals - If and When Block
Ranges, Loops
while and do-While
Break, Labels, and Return
Chapter 3 : Functions in Kotlin
Defining and Invoking Functions
Default Value Parameters and Named Arguments
Top-Level Functions and Top-Level Properties
Chapter 4 : Classes, Interfaces, and Inheritance
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 Overriding Variables
Visibility Modifiers
Type Checking, Casting, and Smart Cast
Enum Class
Chapter 5 : Nulls in Kotlin
Nullable and Non-Nullable Types in Kotlin
Safe Call(?), Elvis Operator (? :), and Non-Null Assertion(!!) to Deal with Null Values
Invoking or Assigning a Nullable Type to a Non-Nullable Type
Chapter 6 : Collections, Arrays, and Lambda Expressions
Introduction to Collections
Introduction to Lambda 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
Chapter 7 : Exceptions in Kotlin and Scope Functions
Part 1 - Handling Exceptions in Kotlin Using try-catch
Part 2 - Introduction to Scope Functions
Apply and Also Scope Function
Let Scope Function
With and Run Scope Function
Chapter 8 : Getting Started with Kotlin and Spring Boot
Overview of the App and Project Setup
Build a Simple Endpoint - Greeting Controller
Constructor Injection in Spring
Setting Up Different Profiles in Spring Boot
Set Up Logging in Kotlin
Chapter 9 : Integration/Unit Testing Using Junit 5
Introduction to Automated Tests and Setting Up JUnit5
Integration Test for Controller
Unit Test for Controller - Using the Mock Mocking Library
Chapter 10 : Build the Course Catalog Service
Set Up the Course Entity and CourseDTO
Create CourseRepository and Configure JPA in application.yml File
Build the POST Endpoint for Adding New Course
Integration 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
Chapter 11 : Unit Testing Controller Layer (Web Tier)
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
Chapter 12 : Bean Validation Using Validators and ControllerAdvice
Name and Category as Mandatory Using @NotBlank Annotation
Implement Custom Error Handling Using ControllerAdvice Pattern
Handle Global RuntimeException Using ControllerAdvice Pattern
Chapter 13 : Custom JPA Queries Using Spring Data JPA and DB Layer Testing Using @DataJpaTest
Retrieve Courses by Name using JPA Query Creation Function
Retrieve Courses by Name Using Native SQL Query
Testing Multiple Sets of Data Using @Parameterized Test
Chapter 14 : GET Endpoint to Retrieve Courses by Name Using @RequestParam
Use Existing GET Endpoint to Retrieve Courses by Name
Write Integration Test to Retrieve Course by Name
Chapter 15 : Entity Relationships Using Spring Data JPA
Adding Instructor Entity into the Course Catalog Service
Adding the Relationship to 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
Chapter 16 : Integrating with Postgres DB
Setting Up the Postgres DB and App to Interact with Postgres
Test the App with Postgres DB
Chapter 17 : Integration Testing Using TestContainers
Setting Up TestContainers for the Integration Test
Configure @DataJpaTest with TestContainers
Chapter 18 : Java and Kotlin Interoperability
Invoking Kotlin Code from Java Class
Invoking Java Code from Kotlin
Useful JVM Annotations in Kotlin
Start your Free Trial Self paced Go to the Course We have partnered with providers to bring you collection of courses, When you buy through links on our site, we may earn an affiliate commission from provider.
This site uses cookies. By continuing to use this website, you agree to their use.I Accept