An Intro to Spring Cloud Zookeeper 1. Introduction In this article, we will get acquainted with Zookeeper and how it’s used for Service Discovery which is used as a centralized knowledge about services in the cloud. Spring Cloud Zookeeper provides Apache Zookeeper integration for Spring Boot apps through autoconfiguration and… Continue Reading spring-cloud-zookeeper

A Quick Guide to Spring Cloud Consul 1. Overview The Spring Cloud Consul project provides easy integration with Consul for Spring Boot applications. Consul is a tool that provides components for resolving some of the most common challenges in a micro-services architecture: Service Discovery – to automatically register and unregister… Continue Reading spring-cloud-consul

Prevent Brute Force Authentication Attempts with Spring Security 1. Overview In this quick tutorial, we’ll implement a basic solution for preventing brute force authentication attempts using Spring Security. Simply put – we’ll keep a record of the number of failed attempts originating from a single IP address. If that particular… Continue Reading spring-security-block-brute-force-authentication-attempts

Building a REST Query Language A mature REST API can be a lot of work, and publishing Resources in a flexible way is usually a balancing act. On the one hand, you want to allow the client to search for information in many flexible ways. On the other hand, you… Continue Reading spring-rest-api-query-search-language-tutorial

Guide to ApplicationContextRunner in Spring Boot 1. Overview It’s well known that auto-configuration is one of the key features in Spring Boot, but testing auto-configuration scenarios can be tricky. In the following sections, we’ll show how ApplicationContextRunner simplifies auto-configuration testing. 2. Test Auto-Configuration Scenarios ApplicationContextRunner is a utility class which runs… Continue Reading spring-boot-context-runner

Mockito and JUnit 5 – Using ExtendWith 1. Introduction In this quick article, we’ll show how to integrate Mockito with the JUnit 5 extension model. To learn more about the JUnit 5 extension model, have a look at this article. First, we’ll show how to create an extension that automatically creates mock… Continue Reading mockito-junit-5-extension

A Quick Guide to @TestPropertySource  1. Overview Spring brings many features to help us with testing our code. Sometimes we need to use particular configuration properties in order to set up the desired scenario in our test cases. In these situations, we can make use of the @TestPropertySource annotation. With this… Continue Reading spring-test-property-source

Guava Functional Cookbook 1. Overview This cookbook is organized into small and focused recipes and code snippets for using the Guava functional-style elements – Predicates and Functions. The cookbook format is focused and practical – no extraneous details and explanations necessary. 2. The Cookbook filter a collection by a condition… Continue Reading guava-functions-predicates