Mockito
-
Core Java

Getting Started with JUnit 5 Testing in Micronaut
Micronaut makes testing Java applications straightforward with native JUnit 5 integration. Its lightweight dependency injection, embedded server support, and simple…
Read More » -
Enterprise Java

Using @MockitoSpyBean in Spring
Testing is an essential part of building reliable Spring Boot applications. Often, we need to observe or modify the behaviour…
Read More » -
Enterprise Java

Mocking AmazonSQS in Unit Tests
Unit tests should be fast, isolated, and deterministic. When your Java application interacts with AWS SQS, you want to avoid…
Read More » -
Core Java

Mocking Logger and LoggerFactory Example
1. Introduction The SLF4J library provides the Logger interface and LoggerFactory utility class to create a logger instance for a…
Read More » -
Core Java

Mockito Stub Getter & Setter Example
Mockito offers a straightforward approach to mocking method calls in unit tests, helping us isolate components and validate their behavior…
Read More » -
Core Java

Mocking JDBC Components in Unit Tests with Mockito
Unit testing JDBC-based code can be challenging due to its reliance on live database interactions. Using Mockito, we can mock…
Read More » -
Core Java

Mockito vs. Mocking the JVM: Bytecode Manipulation for Ultimate Test Control
Mockito is the go-to mocking framework for Java developers, but it has limits—it can’t mock final classes, static methods, or…
Read More » -
Core Java

How to Handle Generic List Matchers in Mockito
Mockito is a widely used Java library for creating mock objects in unit tests. Mocking enables us to replace the…
Read More » -
Enterprise Java

Mock JWT Decoding with JwtDecoder in JUnit Tests
JSON web tokens (JWTs) are widely used for microservices and Spring security authentication. When testing Spring applications, mocking JWT decoding…
Read More »




