Guide to Spring Cloud Stream with Kafka, Apache Avro and Confluent Schema Registry 1. Introduction Apache Kafka is a messaging platform. With it, we can exchange data between different applications at scale. Spring Cloud Stream is a framework for building message-driven applications. It can simplify the integration of Kafka into… Continue Reading spring-cloud-stream-kafka-avro-confluent

Merging java.util.Properties Objects 1. Introduction In this short tutorial, we’ll focus on how to merge two or more Java Properties objects into one. We’ll explore three solutions, firstly starting with an example using iteration. Next, we’ll look into using the putAll() method and to conclude the tutorial, we’ll look at… Continue Reading java-merging-properties

Mockito ArgumentMatchers 1. Overview This tutorial shows how to use the ArgumentMatcher and how it differs from the ArgumentCaptor. For an introduction to the Mockito framework, please refer to this article. 2. Maven Dependencies We need to add a single artifact: <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> <version>2.21.0</version> <scope>test</scope> </dependency> The latest version of Mockito can be… Continue Reading mockito-argument-matchers

A Custom Filter in the Spring Security Filter Chain 1. Overview In this quick article, we’ll focus on writing a custom filter for the Spring Security filter chain. Further reading: Spring Security – @PreFilter and @PostFilter Learn how to use the @PreFilter and @PostFilter Spring Security annotations through practical examples.… Continue Reading spring-security-custom-filter

Java String.charAt() Java The method charAt() returns the character at the specified index. The index value must be between 0 and String.length() – 1. Available Signatures public char charAt(int index) Example @Test public void whenCallCharAt_thenCorrect() { assertEquals(‘P’, “Paul”.charAt(0)); } Throws IndexOutOfBoundsException – if a non-existent or a negative index is… Continue Reading string-char-at

Java String.codePointCount() Java Java String The method codePointCount() returns the number of Unicode code points in the specified range. The text range begins at the first index and ends at the second index – 1. Available Signatures public int codePointCount(int beginIndex, int endIndex) Example @Test public void whenCallCodePointCount_thenCorrect() { assertEquals(2,… Continue Reading string-code-point-count