A quick and practical guide to Mockito’s MockedConstruction.
Jonathan has more than 10 years of experience as a Senior Software Engineer with a focus on Java. He is particularly passionate about testing and ensuring the quality of the systems he is responsible for. He has contributed to several open source projects and can now be found in Spain looking after the ESA science archives.
Here's what I've written (so far):
Baeldung on Java
- Testing (18)
- Spring Boot (5)
- Jakarta EE (3)
- Data (3)
- Java Dates (2)
- Java (2)
- Jackson (2)
- HTTP Client-Side (2)
- Core Java (2)
- Spring (1)
- REST (1)
- NoSQL (1)
- Java Numbers (1)
- JVM (1)
- JSON (1)
Explore several ways of mocking a URL connection to write stand-alone unit tests that don’t rely on external services.
Explore two simple approaches to configure our Lombok builder classes to work seamlessly with Jackson.
Learn how to handle exceptions in our routes using Apache Camel.
Learn how we can route messages based on conditions in our routes using Apache Camel.
Learn how to test Apache Camel routes in Spring Boot.
Learn how to set up and connect to a hosted Cassandra Astra Database.
Write reliable, self-contained unit tests using CassandraUnit.
Learn how to capture events using OkHttp.
Explore a couple of examples of how we can use Mockito to mock static methods.
Learn how to create interceptors using OkHttp.
A quick and practical overview of Mockito MockSettings.
Learn two simple approaches for unmarshalling JSON arrays using camel message routing and the camel-jackson component.
Learn how to create a simple Spring Batch job using Spring Boot.
Learn about a couple of approaches for testing Kafka applications with Spring Boot.
Explore the System Rules library in detail.
Learn about approaches for testing System.out.println.
Explore two approaches to capturing screenshots using Selenium WebDriver.
Learn how to get the week number for a given date in Java.
Learn the most common ways of calling Python code from Java.
Learn about the Pattern Matching with instanceof in Java 14.
Learn how to check for null before converting a string to a double using Double.parseDouble.
Learn how we can use Mockito to mock a simple fluent API.
Learn how to use the JUnit 4 Rules Model to extend the behavior of JUnit tests
Learn how you can process the results of test method executions using the JUnit TestWatcher.
Learn how to use a temporary directory for JUnit tests, with the @TempDir annotation
Understand the reasons behind the Mockito UnnecessaryStubbingException and how to avoid it.
An in-depth look at using the ProcessBuilder API to manipulate OS processes
Learn how to enable verbose GC in Java and how to interpret the resulting logs.
A quick and practical guide to merging Properties objects.
Learn how to make use of the test support in Jersey.
Learn how to handle the MockitoJUnitRunner class deprecation warning.
Learn how to use Bean Validation with the Jersey library
A quick tutorial to understanding MVC in Jersey using Freemarker.
Explore two different ways of testing callbacks when using Mockito.
Learn how to get an object representing a Date from a String in Java
Baeldung on Linux
- Scripting (2)
- Files (2)
- File Editing (2)
- Web (1)
- File Conversion (1)
- File Compression (1)
Learn various methods to exit a shell script from within a subshell on Linux.
Learn some of the basic capabilities that ImageMagick provides for manipulating images via the command line.
Explore several alternatives for extracting and viewing the contents of WAR files on the Linux platform.
A quick and practical overview of trimming strings after sequence occurrences on Linux.
Explore the capabilities that jq provides for processing and manipulating JSON via the command line.
Learn strategies for looping through directories in Linux
Baeldung on Scala
- Testing (1)
Learn about ScalaTest, a comprehensive testing framework for Scala.