Test JSON with a few lines of code

JSONassert helps you writing JSON unit tests You have to write a unit test and JSON is involved. Usually this will end up in a lot of lines of code. You know the situation, I bet. Here JSONassert comes into play. It allows to write JSON unit tests with just a few lines of code. For example checking an […]

Are we doing microservices?

Recently, an admin asked me if we are doing microservices. I thought about it for a few moments. And what I said comes here as a checklist. It’s a really simple test with quick yes or no. Single Responsibility Principle Is your service small and focused on doing one thing well? Domain-Driven Design Is your service […]

Reading YAML configurations in Java

How can I use YAML for my Java application? YAML is human-readable and a cool datat interchange format. It’s lean appearance make it special e.g. for configuration files or when humans view or edit data structures. It’s well suited for hierachical data presentation and you can easily map common data structures. Jackson and SnakeYaml Here I […]

Initializing HashMaps in Java

How can I initialize a HashMap with some pre-defined entries? In this article I’ll show you how you create a HashMap with values. Java doesn’t provide a method like Array.asList(). For initializing a map you have to implement something like that: So this is the double brace initialization idom. I don’t like this way. It’s not very readable, it’s creates a […]