Testing @ConfigurationProperties in Spring Boot

*** Update *** I updated the example on GitHub to Spring 2.5.X! The latest post on this topic is at https://tuhrig.de/testing-configurationproperties-in-spring-boot-2-5-x. I recently worked on a library for using AWS Kinesis in Spring Boot. As many other libraries, this particular one provided a powerful configuration. To implement the configuration, we used Spring Boot’s @ConfigurationProperties (as […]

Encapsulated modules and clean tests with Spring’s @Configuration

Usually we use Spring’s @Configuration to define some special beans. A classic example is the definition of a data source:

However, we can also use Spring’s @Configuration to build better modules which helps us to writer cleaner tests. Let’s go through an example. An example Let’s assume we have an application which uses domain […]