The Test With Spring course is now completely free. Because I didn't want to spent any more time or money on keeping the Wordpress website up to date, I transformed it into a static HTML website. Read More
Programming
Writing Unit Tests for "Normal" Controllers With Spring MockMvc: Test Slice Configuration
This blog post describes how we can configure the system under test by using Spring Boot's test slice configuration (the @WebMvcTest annotation) when we are writing unit tests for view-rendering Spring MVC controllers. We will learn how we can get the required dependencies and configure the system under test. Read More
Writing Unit Tests for "Normal" Controllers With Spring MockMvc: Standalone Configuration
This blog post describes how we can configure the system under test by using the standalone configuration of Spring MockMvc when we are writing unit tests for view-rendering Spring MVC controllers. We will learn how we can get the required dependencies and remove duplicate configuration code from our test classes by using both object mother and HTTP request builder classes. Read More
Introduction to Spring MockMvc
This blog post is a complete introduction to Spring MockMvc. It highlights the benefits of Spring MockMvc, identifies its key components, and describes how we can get the required dependencies with Maven and Gradle. Read More
Getting Started With MockK: The Setup
This blog post describes how we can configure the system under test and replace its dependencies with mocks when we are writing unit tests for a Kotlin application by using JUnit Jupiter and MockK. We will learn to get the required dependencies and configure the system under test by using both manual and extension-based configuration. Read More
Writing Unit Test With MockMvcTester: Returning an Object as JSON
This blog post describes how we can write unit tests for a Spring MVC REST API endpoint that returns an object as JSON. We will identify the tests we must write, learn to eliminate duplicate request building code from our test class, and write assertions for the HTTP response with MockMvcTester and AssertJ. Read More