Mockito
-
Enterprise Java
Clean Code from the Trenches – Writing Executable Specifications with JUnit 5, Mockito, and AssertJ
Executable Specifications are tests that can also serve as design specifications. They enable technical and business teams to get on…
Read More » -
Core Java
Mockito Matchers Precedence
This post is opinion. Let’s look at the verify method in Mockito for testing in Java. Example: verify(myMock).someFunction(123) – expects…
Read More » -
Enterprise Java
Seven Testing Sins and How To Avoid Them
Throughout this article I will be using Java within code snippets, whilst also using JUnit and Mockito. This article aims…
Read More » -
Enterprise Java
Simplify integration testing of legacy application with Spock 1.2
Learn how leverage Spock 1.2 to slice a Spring context of a legacy application writing integration tests. Have you ever…
Read More » -
Core Java
Java: Mocking a ResultSet using Mockito
This post shows how you can mock a java.sql.ResultSet using Mockito. It can be used to help unit test code…
Read More » -
Enterprise Java
Spring Framework with Maven Tutorial
In this post, we shall demonstrate how to use Maven dependencies for Spring framework for very specific use-cases. The latest…
Read More » -
Core Java
Convenient mocking in Mockito with JUnit 5 – the official way
Starting with the version 2.17.0 Mockito provides the official (built-in) support for managing a mocking life cycle if JUnit 5…
Read More » -
Core Java
Modern TDD-oriented Java 8 JUnit test template for Idea (with Mockito and AssertJ)
Tune up your JUnit test class template for Idea with the BDD-like syntax, Java 8 and the Mockito-AssertJ duo. Topics…
Read More » -
Core Java
Expected Exception Rule and Mocking Static Methods – JUnit
Today I was asked to consume a RESTful service so I started implementing it following Robert Cecil Martin’s rules for…
Read More »