Guide to Stream.reduce() 1. Overview The Stream API provides a rich repertoire of intermediate, reduction, and terminal functions, which also support parallelization. More specifically, reduction stream operations allow us to produce one single result from a sequence of elements, by applying repeatedly a combining operation to the elements in the… Continue Reading java-stream-reduce

The DAO with Spring and Hibernate 1. Overview This article will show how to implement the DAO with Spring and Hibernate. For the core Hibernate configuration, check out the previous Hibernate 5 with Spring article. 2. No More Spring Templates Starting Spring 3.0 and Hibernate 3.0.1, the Spring HibernateTemplate is… Continue Reading persistence-layer-with-spring-and-hibernate

Guide to @EnableConfigurationProperties 1. Introduction In this quick tutorial, we’ll show how to use an @EnableConfigurationProperties annotation with @ConfigurationProperties annotated classes. 2. Purpose of @EnableConfigurationProperties Annotation @EnableConfigurationProperties annotation is strictly connected to @ConfiguratonProperties. It enables support for @ConfigurationProperties annotated classes in our application. However, it’s worth to point out that… Continue Reading spring-enable-config-properties

Injecting Mockito Mocks into Spring Beans 1. Overview This article will show how to use dependency injection to insert Mockito mocks into Spring Beans for unit testing. In real-world applications, where components often depend on accessing external systems, it is important to provide proper test isolation so that we can… Continue Reading injecting-mocks-in-spring