Mockito Strict Stubbing and The UnnecessaryStubbingException 1. Overview In this quick tutorial, we’ll learn about the Mockito UnnecessaryStubbingException. This exception is one of the common exceptions we’ll likely encounter when using stubs incorrectly. We’ll start by explaining the philosophy behind strict stubbing and why Mockito encourages its use by default.… Continue Reading mockito-unnecessary-stubbing-exception

Java 9 CompletableFuture API Improvements 1. Introduction Java 9 comes with some changes to the CompletableFuture class. Such changes were introduced as part of JEP 266 in order to address common complaints and suggestions since its introduction in JDK 8, more specifically, support for delays and timeouts, better support for… Continue Reading java-9-completablefuture

Spring Data Annotations 1. Introduction Spring Data provides an abstraction over data storage technologies. Therefore, our business logic code can be much more independent of the underlying persistence implementation. Also, Spring simplifies the handling of implementation-dependent details of data storage. In this tutorial, we’ll see the most common annotations of… Continue Reading spring-data-annotations

Programmatically Create, Configure and Run a Tomcat Server 1. Overview In this quick article, we’re going to programmatically create, configure and run a Tomcat server. 2. Setup Before we get started, we need to setup our Maven project by adding the below dependencies to our pom.xml: <dependencies> <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>tomcat-catalina</artifactId>… Continue Reading tomcat-programmatic-setup