
In this lecture, I will give you all a quick introduction to the course and its objectives.
In this lecture, I will cover the pre-requisites that are needed to enroll in this course.
In this lecture, I will explain about the need for WireMock and how it helps with seamless integration of RESTFUL API integrations in to your project.
In this lecture, I will give you all a quick introduction to What is Wiremock?.
In this tutorial, I will cover the differences between wiremock and the mocking libraries in Java (Mockito).
In this lecture, I will give you a quick overview of the application that we are going to build as part of this course.
This lecture has the link for the complete source code that's available in GitHub.
In this lecture, we will explore the movies restful service and the different endpoints thats part of the restful Service.
In this lecture, we will explore the different endpoints thats part of the Movies restful service.
In this lecture, we will set up MoviesApp client application. This is a gradle based project that uses Spring WebClient, Lombok, Jackson JSON library and JUnit5.
In this lecture, I will cover the differences between the Spring WebClient and RestTemplate. Why WebClient is the best choice for writing REST Clients ?
In this lecture, we will set up the movies domain object to parse the HttpRequest and HttpResponse.
In this lecture, we will write code to build the MoviesRestClient class using the Spring WebClient.
In this lecture, we will write the JUnit test for the MoviesRestClient using Junit5
In this lecture, we will write the code to build the REST client to retrieve the movie by movie-id.
In this lecture, we will write the code to build the REST client to retrieve the movie by movie-name.
In this lecture, we will write the code to build the REST client to retrieve the movies by movie-year.
In this lecture, we will write the code to build the REST client to perform a "POST" call to add a new movie to the service.
In this lecture, we will write the code to build the REST client to perform a "PUT" http call to update an existing movie.
In this lecture, we will write the code to build the REST client to perform a "DELETE" call to delete a movie using ID.
In this lecture we will add necessary dependencies to set up wiremock in the JUnit Test Case for the MoviesApp application
In this lecture, I will give you all a quick overview of whats covered in this section.
In this lecture, we will code the first stub with wiremock using the anyUrl() method and have the RestClient interact with WireMock Server instead of the actual Movie Service.
In this lecture, I will explain about how WireMock works "behind the scenes" and how WireMock "matches the stub".
In this lecture, we will code and learn the different approaches of creating a stub matching the urls using the urlPathEqualTo().
In this lecture , we will code and learn about how do we match a URL with path parameter and create a stub thats dynamic to read any path parameter value.
In this lecture, we will code and learn about how to dynamically generate the response based on the input to the httprequest.
In this lecture, we will code and learn about how to create a WireMock stub thats going to return a 404 HttpResponse.
In this lecture, we will code and learn the urlEqualTo() method thats part of the WireMock DSL to match the correct HTTP request.
In this lecture, we will code and learn about how to build a dynamic response stub based on the input from the httprequest.
In this lecture, we will code and learn about how to create a wiremock stub that matches a request body.
In this lecture, we will code and learn about how to create a dynamic wiremock stub using Response Templating.
In this lecture, we will code and learn about how to create a stub thats going to respond with 400 Bad Request response.
In this lecture, we will code and learn about how to create a stub for a HTTP PUT.
In this lecture we will code and learn about how to create a stub for a HTTP DELETE.
In this lecture we will learn about "Why do we need to verify the Stub"?
In this lecture, we will code and learn about "How to use Verify DSL" to make sure the endpoint that returns no response body is invoked or not.
In this lecture, I will give you all quick introduction to Server/Fault responses in a REST based interaction.
In this lecture, we will code and explore about how to create stubs for the 5xx Response Codes.
In this lecture, we will code and learn about how to simulate network errors.
In this lecture, we will code and learn about how to configure a read and write timeout in WebClient.
In this lecture, we will code and learn about simulating Latency and testing the client times out within the given time.
WireMock is a simulator for HTTP-based APIs or MockServer.
REST APIs are everywhere today as it's the modern and easiest way to build a functionality and expose it to the real world.
When it comes to writing Unit Test Cases that involve REST-based interactions there is always a challenge in testing error responses , network faults, latency and timeouts. WireMock is going to solve this problem of the application code that depends on the external service by mocking the actual service.
In MicroServices Architecture, It is pretty common for services to depend on one other and it's always a challenge to write test cases for the code that depends on other external services. WireMock provides the necessary tools to simulate an external service so the code that depends on the external service can be tested which helps to build the robust REST Client.
This course is going to cover the techniques that are listed below using WireMock:
Service Virtualization
Simulating the External Service
Simulating Latency
Simulating Error response
Simulating Network errors
Learn to integrate the most powerful HTTP Mock library - WireMock into your application to build a Resilient and Robust REST API clients.
Why you should use WireMock ?
If your application depends on an API that does not exist but still you would like to build the REST Client then WireMock can help support that kind of development.
If you would to cover all the edge cases scenarios such as NetWork Errors, Faults, Latency and RunTime Exception in your REST Client then start using WireMock
If you would like to write Unit Test cases that covers all the possible scenarios that can happen in a REST based interaction then start using WireMock.
In a MicroServices Architecture it is pretty common for your services to depend on other. WireMock is a powerful simulation tool to simulate the service that your application depends on it. In a nutshell, WireMock is a Service Virtualization tool.
What's Covered in this Course?
Introduction to WireMock
Learn to build REST Client using the Spring WebClient.
Learn to virtualize an External Service
Learn to create Stubs using WireMock
Learn to Simulate Network Errors, Latency, Network Timeouts and more.
Learn to run WireMock using JUnit4 and JUnit5 platform
Learn to integrate and run WireMock in Spring Boot application
Prerequisites for the Course:
Experience working with Java applications
Java 8 or Higher
Knowledge of building RESTFUL API Clients
Knowledge of RESTFUL API
Experience working with Gradle/Maven
Experience working with Intellij, Eclipse etc.,
Section : Introduction to WireMock
In this section, I will cover the Introduction to WireMock from the theoretical perspective.
Why WireMock ?
What is WireMock ?
WireMock vs Mocking Libraries - A quick comparison between WireMock and Mockito.
Section : Setting up the WorkSpace for the course
In this section, we will set up the workspace for this course.
Section : Build REST Clients using Spring WebClient - Hands On
In this section, we will code and learn how to build a REST client using WebClient.
Set up the base project movies-app for this course
Build the Rest Clients that will be used throughout the course using Spring WebClient
Build Rest Clients that covers the HTTP Methods such as GET, POST, PUT and DELETE
Section : Setting Up WireMock
In this section we will configure the WireMock in to our movies-app project.
Section : Build Stubs Using WireMock - Hands On
In this section, we will code and learn about how to create Stubs using wiremock and have test case interact with wiremock instead of the actual service.
Learn about how to create stubs using WireMock
Learn to create stubs for different HTTP Methods such as GET, POST, PUT and DELETE
Learn to Simulate HTTP Responses with 400-Bad Request
Learn about how to perform ResponseTemplating in WireMock
Section: Verifying the Stubs - Hands On
In this section ,I will cover about how to make sure the stubs are invoked as expected by using the Verification DSL.
Explore the Verify DSL in WireMock
Section : Simulating Server/Fault Responses - Hands On
In this section , I will cover how to simulate the fault HTTP responses such as 5xx Errors, Fault Responses using WireMock.
Learn about the difference between ServerError and Fault responses
Learn to simulate a Server Error using WireMock
Learn to simulate a Network Error using WireMock
Section : Simulating Latency - Hands On
In this section, I will cover how to configure Timeout and simulate latency so that the client times out if the response is not received within the configured time.
Learn to configure the timeout in the REST Client
Learn to Simulate Latency and test your REST Client times out as expected
Section : Selective Proxying - Hands On
In this section, we will learn about "What is Selective proxying?" and "how to implement Selective proxying" using Wiremock.
Learn about What is Selective Proxying? and When to use Selective Proxying?
Learn to simulate Selective Proxying using WireMock
Section : Running WireMock on JUnit4
In this section, we will code and learn how to run a wiremock on a JUnit4 based environment.
Section : Running WireMock on Spring Boot - Hands On
In this section, I will cover how to run and configure WireMock in a Spring Boot project.
Section: Running WireMock with Spring Boot and JUnit5
In this section, we will code and learn about how to run the Spring Boot Project in a JUnit5 environment.
By completing this course, you will have a pretty good idea about the following:
How to Integrate WireMock in to your project
How to Build resilient RESTFUL API Clients
Thanks for taking your time to view my course and hope to see you in my course.