
Discover JUnit 5, a versatile testing framework, using annotations like @Test and @BeforeAll to build reliable tests; follow a practical average calculation example with assertions and exception handling.
Explore the differences between mock, spy, and stub using the mosquito library to mock dependencies, provide hardcoded responses, and verify method calls in tests.
Learn to design and test an airport management flow with mock and spy testing using JUnit, Mockito, and WireMock, from pilot and plane services to control tower and notification service.
Showcases testing of Java Spring apps using G-Unit, mosquito mocks, stubs, and spies, detailing test setup, mock behavior, and verification of interactions in a flight scenario.
Learn how to mock exceptions in Java Spring tests, verify rollback flows across pilot, plane, and control tower services, and ensure correct calls when exceptions occur.
Explore exception testing with spies in java spring apps, force spies to throw exceptions, forward them through prepare flight, and reset mocks to verify pilot, plane, and control tower services.
Learn how to use wiremock to mock rest api calls, replacing hardcoded data with simulated external services, and verify requests and responses in Java Spring app tests.
In this flow part 2, implement the control tower check, simulate takeoff approvals with a map, and orchestrate pilots, planes, and notifications using mocks and spies, with rollback handling.
Reset mocks to prevent cross-test contamination in JUnit, Mockito, and WireMock, and understand how static mocks retain interactions and affect verifications.
Learn to scaffold a Spring app with Spring initializer, configure Maven, annotate components with @Component and @Autowired, and expose a rest API for preparing a flight.
Declare mocks and spies in spring tests with @Mock, @Spy, and @InjectMocks, inject them into the command center service, and verify test flows with spring-based testing.
Learn to build a mock server with Postman by defining endpoints for pilot service, plane service, control tower, and notification service, simulating JSON responses, and preparing for WireMock.
Spring API client using RestTemplate to call a Postman mock server, wiring properties, and exposing endpoints for pilots, planes, approvals, and notifications.
Replace hardcoded data with data from the mocked REST API by injecting the API client and fetching pilots, flight lists, and approvals across pilot, plane, and control tower services.
Build and run spring tests with wiremock to mock http calls, configure test properties, and validate pilots, planes, approvals, and notifications via mocked endpoints.
Build a dummy rest api with Spring Boot and Spring Web. Test its bookstore endpoints using Postman to verify get all, get by id, create, and delete.
Learn to test a dummy rest API with Postman by creating a collection, sending get and post requests, writing pre request scripts and tests, and verifying status codes.
Learn to write robust Postman tests that uncover corner cases, verify get by ID functionality, and handle 200, 404, and 400 responses in a controlled environment.
master postman in depth to test rest apis, verify get by id and 404 responses, and use pre request scripts and environment control to ensure reliable tests.
"Testing Java Apps with JUnit, Mockito, Wiremock, and Postman" is a course designed for Java developers who want to improve their skills in creating robust, high-quality software. It covers the use of JUnit, a popular Java framework for unit testing, along with the Mockito and Wiremock libraries for creating mock objects and simulating HTTP interactions. Additionally, the course covers the use of Postman for testing and debugging RESTful API's. Throughout the course, you will learn how to write test cases that are easy to maintain, understand and execute. The course will also cover the best practices and common pitfalls to avoid when testing Java applications. By the end of the course, you will have the knowledge and skills needed to confidently create, execute, and maintain automated tests for your Java applications.
You will learn about :
JUNIT concepts - we first write the code for our app, then we identify what is missing to be proud of our code and at the end of this chapter we implement some tests that will cover all our functionality.
how to use POSTMAN to write automated tests and also build your own mock server. POSTMAN is used, most of the times, just for making requests to our app, but in reality it has a lot of functionality that can make your life easier
Mockito - we will talk about stubs/spies/mocks. We first write some tests that will use stub/mock/spy for the simple java app and after that we learn what changes in our approach. You will need this information to know exactly when to use what.
Wiremock - you will learn how to an app that uses a rest api client
These are must know knowledge if you want to advance your career and write better code.