Recent posts

Oct 9, 2020

Generate Leanpub TOC from Asciidoc files

I just released the first version of my Taming Thymeleaf book on leanpub. Since I am using Asciidoctor to generate the PDF, there is no automatic table of contents generation for the landing page. Luckily, leanpub allows to enter some HTML to manually create the TOC. A perfect opportunity to use my rusty Groovy skills once more to generate this HTML. I have my Asciidoc files all in a _chapters directory grouped per chapter:

Read More...

Jul 20, 2020

Error handling library for Spring Boot

An important part of any decent REST API is good error handling. Good error handling has 2 major goals: It will help the developers of your API to understand exactly what is wrong when they learn to work with your API. It will allow to have the mobile app or Single Page Application or whatever that is using your app to give precise error message to the end-user of the application. We will first take a look at what Spring Boot offers out-of-the-box, and next look at how Error Handling Spring Boot Starter improves this.

Read More...

Jun 8, 2020

Generate all enum values for Spring REST Docs documentation

If you document your REST API with Spring REST Docs, you have probably came across fields that refer to enum values. This little tip will show you how to automatically include all enum values in the description of the field.

Read More...

May 8, 2020

AssertJ test cause of exception

AssertJ 3.16.0 has just been released. It has a feature I contributed to allow testing the (root) cause of an exception. This blog post will show how to use this to our advantage.

Read More...

Apr 17, 2020

Spring Boot test slices with custom annotations

Spring Boot has first-class support for testing, both unit and integration testing. To keep your tests running fast, there is the concept of Test Slicing. By only loading the relevant part of the complete application in a test, the tests are focused and run faster since Spring does not need to load everything. This blog post will show how to use a custom annotation to ensure your unit/integration tests are all consistent with little effort.

Read More...

Mar 10, 2020

Port of the Laravel Intermediate Task List tutorial to Spring Boot with Thymeleaf

Laravel is a very interesting PHP framework for building web applications. Their docs have a nice tutorial to build a task list to explain many of their concepts. This blog post basically mirrors that tutorial but shows how to build the same web application using Spring Boot and Thymeleaf.

Read More...

Mar 3, 2020

UUID based Value Objects with Spring Boot REST API

The previous blog post showed how to use Value Objects with a REST API with Spring Boot. In that post, the value object used a long under the hood. This post shows an alternative using UUID objects instead.

Read More...

Feb 26, 2020

Value Objects with Spring Boot REST API

In Using primary key objects with Spring Data and Hibernate, I explained how to use Value Objects for interaction with the database. This time, I will focus on how to do something similar at "the other end" of the application, in the REST API.

Read More...

Feb 17, 2020

Using Tailwind CSS with Spring Boot and Thymeleaf

Tailwind CSS is an interesting utility-first CSS framework for rapidly building custom designs. It is perfectly possible to use this in a Java Spring MVC application that uses Thymeleaf for server-side rendering.

Read More...

Feb 11, 2020

Testcontainers-cypress release 0.4.0

Testcontainers-cypress 0.4.0 is released with support for Cypress 4.0.1 which has Firefox support.

Read More...