WireMock for Java Developers

WireMock for Java Developers
WireMock for Java Developers
English | MP4 | AVC 1920×1080 | AAC 48KHz 2ch | 4h 28m | 1.61 GB

Learn to effectively integrate and build RESTful API clients into Java and Spring Boot applications using WireMock.

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.

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

Table of Contents

Getting Started with Course
1 Course Introduction & Objectives
2 Pre-Requisites

Introduction to WireMock
3 Why WireMock
4 What is WireMock
5 WireMock vs Mocking Libraries

Setting up the WorkSpace for the course
6 Overview of the application
7 Set up the Movies RESTFUL Service
8 Exploring the Movies RESTFUL Service

Build REST Clients using Spring WebClient – Hands On
9 Setting up the Movies App
10 RestTemplate vs Spring WebClient
11 Setting up the Movies Domain
12 Build Movies REST Client using Spring WebClient
13 Build Movies REST Client test using JUnit5
14 WebClient – Retrieve Movie by Movie-ID
15 WebClient – Retrieve Movie by Movie-Name
16 WebClient – Retrieve Movie by Year
17 WebClient – Add a new Movie -HTTP POST
18 WebClient – Update a Movie – HTTP PUT
19 WebClient – Delete a Movie – HTTP DELETE

Setting Up WireMock
20 Configuring WireMock

Build Stubs Using WireMock – Hands On
21 Overview
22 Create the very first Stub
23 How WireMock works Behind the scenes and Matches the Stub
24 URL Matching Stub – urlPathEqualTo()
25 URL Matching Stub using urlPathMatching()
26 Generate Dynamic Http Response using ResponseTemplateTransformer
27 Stub with 400 HttpStatus as Response
28 Stub matches a Query Param using urlEqualTo()
29 Generate Dynamic Response Stub by reading Query Param from the request
30 Stub with RequestBody – HTTP POST
31 Dynamic Response Stub – HTTP POST
32 Stub with 400 Bad Request Response – HTTP POST
33 Stub for HTTP PUT
34 Stub for HTTP Delete

Verifying the Stubs – Hands On
35 Why Verify the Stubs
36 Explore the verify DSL

Simulating Server Fault Responses – Hands On
37 Introduction to Server Fault Responses
38 Simulating 5xx Response
39 Simulating Fault Responses – Network Errors

Simulating Latency – Hands On
40 Configuring read write Timeout – Spring Webclient
41 Simulating Latency

Selective Proxying – Hands On
42 What is Selective Proxying
43 Simulating Selective Proxying

Running WireMock on Junit 4
44 WireMock on JUnit4
45 Run WireMock on JUnit4

Running WireMock on Spring Boot – Hands On
46 Overview and Project SetUp
47 Building the Client Code
48 Run WireMock on Spring Boot using @AutoConfigureWireMock – Approach 1
49 Run WireMock on Spring Boot using WireMockRule- Approach 2

Running WireMock with Spring Boot and JUnit5
50 Configuring Spring Boot for JUnit5
51 Run WireMock with Spring Boot and JUnit5
52 Run WireMock with Spring Boot JUnit5 using WireMockExtension