Posted by Steven

ArchUnit can be used to test dependencies between packages in Java. I use it to test that application slices do not depend on each other, but are disjunct:

Posted by Steven

This article is about why annotating the Spring application class with @ComponentScan may cause problems when also using Spring Web MVC Test.

The code can be found here.

General Setup

The demo application is a simple Spring Boot application with a component scan directly in the application class:

Posted by Steven

This is a guide on how to approach me regarding job offers.


Currently, I'm not actively searching for a new job. This article is meant to be a guide for people who are offering extraordinary jobs that I would be a perfect fit for.

Stevens priorities

From most important to less important:

1. Content.

I want to do something useful,
contribute to something great and
add value
while having a positive ecological and sociological impact.

Posted by Steven

Spring MVC is a great way of creating REST interfaces. Many convenience classes and methods are provided, such as the Response Entity object for returning data:

Posted by Steven

There are common tasks in programming I never performed in a production project. Formatting currency is one of them. I only noticed that when I searched a library that would offer formatting methods. After searching for a while and wondering why so many libraries exist, a colleague found a surprisingly easy solution: String.format(). Here is some code to show how to format currency with plain Java.

Posted by Steven

Recently, I finished "Influence" by Robert B. Cialdini.  I like reading books about Psychology and "Influence" both is comprehensible and useful. In this article, I want to highlight some of the most important take-aways I found to be of relevance to my life.

Posted by Steven

Recently, I wanted to keep the change history of entities saved via Hibernate and also have a versioned database. Hence, I used Hibernate Envers and Liquibase.

The tables for envers, both the revinfo table and the _AUD tables for each entity, have to be included in the changeset of Liquibase:

Posted by Steven

Recently, I finished reading the book "Principles" by Ray Dalio. This is a short review of my most important take-aways from the book.

First of all, the design and font of the book really resonates with me. That's the kind of design I choose for my own book ...

Posted by Steven

Some time ago, an application of mine that is deployed in the Pivotal Cloudfoundry began throwing errors and crashed:

Spring Test Slices

22 Dec 2019
Posted by Steven

In this article, I want to share what I learned about testing a Spring application without loading it completely. This can be done by using @DataJpaTest, @WebMvcTest, @SpringBootTest, @AutoConfigureMockMvc and @DataJpaTest. These annotations are part of "test slices" of Spring which allow to test certain beans of the application without loading other beans.