Video description
WireMock is a simulator for HTTP-based APIs or MockServer. REST APIs are everywhere today as they're the modern and easiest way to build functionality and expose them 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 will solve the problem of application code that depends on an external service by mocking the actual service.
In the microservices architecture, It is pretty common for services to depend on one another and it's always a challenge to write test cases for code that depends on other external services. WireMock provides the necessary tools to simulate an external service so that code that depends on the external service can be tested; this helps to build a robust REST client.
This course covers the following techniques using WireMock:
· Service virtualization
· Simulating an external service
· Simulating latency
· Simulating error responses
· Simulating network errors
Learn to integrate the most powerful HTTP Mock library, WireMock, into your applications to build a resilient and robust REST API client.
What You Will Learn
- Complete knowledge of how to build resilient RESTful API clients
- Write automated tests which involve RESTful API clients using JUnit
- Using WireMock as a powerful tool to simulate HTTP interactions
- Mock an external service using WireMock
- Build a robust REST client by simulating network errors, network latency
- Learn to mock a RESTful Service
- Learn to write unit tests that involve RESTful API interactions
Audience
This course is for developers who would like to learn to build RESTful API clients using Spring WebClient, Java developers who would like to learn to build resilient RESTful API clients and developers who are working in the microservice architecture and would like to learn how to simulate other services involving REST API invocations. Developers who would like to write unit tests that cover latency, timeouts, and network faults and also who would like to write unit tests that depend on other services.
About The Author
Dilip Sundarraj: Dilip Sundarraj is a software engineer who has experience with building software since 2008. He is passionate about learning modern technologies and staying up to date with all the modern technologies, tools, frameworks, and more. He loves to share his knowledge with the world and that is one of the key reasons for him to be in the online teaching industry.
He loves interacting with other software developers and believes that this helps him share knowledge and learn from them. During his leisure time, he loves to play cricket, watch movies, and work out in the gym to have a balance between physical and mental strength.
Dilip has a YouTube channel named Code with Dilip, where he has been sharing a lot of technical content related to languages, frameworks, best practices, and more.
Table of contents
- Chapter 1 : Getting Started with Course
- Chapter 2 : Introduction to WireMock
- Chapter 3 : Setting up the WorkSpace for the course
-
Chapter 4 : Build REST Clients using Spring WebClient - Hands On
- Setting up the Movies App
- RestTemplate vs Spring WebClient
- Setting up the Movies Domain
- Build Movies REST Client using Spring WebClient
- Build Movies REST Client test using JUnit5
- WebClient - Retrieve Movie by Movie-ID
- WebClient - Retrieve Movie by Movie-Name
- WebClient - Retrieve Movie by Year
- WebClient - Add a new Movie -HTTP POST
- WebClient - Update a Movie - HTTP PUT
- WebClient - Delete a Movie - HTTP DELETE
- Chapter 5 : Setting Up WireMock
-
Chapter 6 : Build Stubs Using WireMock - Hands On
- Overview
- Create the very first Stub
- How WireMock works Behind the scenes and Matches the Stub?
- URL Matching Stub - urlPathEqualTo()
- URL Matching Stub using urlPathMatching()
- Generate Dynamic Http Response using ResponseTemplateTransformer
- Stub with 400 HttpStatus as Response
- Stub matches a Query Param using urlEqualTo()
- Generate Dynamic Response Stub by reading Query Param from the request
- Stub with RequestBody - HTTP POST
- Dynamic Response Stub - HTTP POST
- Stub with 400 Bad Request Response - HTTP POST
- Stub for HTTP PUT
- Stub for HTTP Delete
- Chapter 7 : Verifying the Stubs - Hands On
- Chapter 8 : Simulating Server/Fault Responses - Hands On
- Chapter 9 : Simulating Latency - Hands On
- Chapter 10 : Selective Proxying - Hands On
- Chapter 11 : Running WireMock on Junit 4
- Chapter 12 : Running WireMock on Spring Boot - Hands On
- Chapter 13 : Running WireMock with Spring Boot and JUnit5
Product information
- Title: WireMock for Java Developers
- Author(s):
- Release date: October 2019
- Publisher(s): Packt Publishing
- ISBN: 9781839210747
You might also like
book
Java 8 in Action
Java 8 in Action is a clearly written guide to the new features of Java 8. …
book
Modern Java in Action
Manning's bestselling Java 8 book has been revised for Java 9 and 10! In Modern Java …
video
Java SE 11 Developer (1Z0-819)
18+ Hours of Video Instruction Description An intensive study resource designed to guide you in best …
book
Java Concurrency in Practice
"I was fortunate indeed to have worked with a fantastic team on the design and implementation …