Here in this tutorial I will tell you what are Dynamic Tests and @TestFactory in Junit 5 and how to create @TestFactory in Junit 5. Test cases, annotated with @Test, are static in the sense that they are fully specified at compile time, and their behavior cannot be changed by anything happening at runtime. In…

Posted in Junit

Dynamic Tests – @TestFactory in Junit 5

Introduction Here in this tutorial I will show you an example on how to test private methods using Junit framework. I am using Junit 5 framework to test the private method. Using Mockito framework you won’t be able to test private methods, but using PowerMock core API you will be able to test the private…

Posted in Junit Spring Boot

How to test Private Methods using Junit 5

Introduction In this tutorial I am going to show you an example on CodeIgniter 4 multi language website. So the website built on CodeIgniter multilingual or multi-languages will have representations of the same information in different languages. I am going to use three different languages en (English), hi (Hindi), fr (French). You can have more…

Posted in Codeigniter

CodeIgniter 4 Multi Language Website

In this tutorial I am going to show you how lookup method injection works in Spring framework. You may face a situation where you need to inject prototype scoped bean into singleton scoped bean. For singleton scoped bean a new instance or object is created and the same is returned each time it is injected…

Posted in Spring Boot Spring Core

Inject Prototype Bean into Singleton Bean in Spring – Lookup Method Injection

In this example I am going to tell you how to map composite primary key to entity class in your JPA Hibernate entity class. Composite primary key is a combination of two or more columns made together as a primary key. Therefore the combination of column values will be as a unique instead of having…

Posted in Hibernate JPA

How to map Composite Primary Key to Entity Class in JPA Hibernate

In this example I am going to show you how to find all paths from root to leaf nodes in binary tree. So I am going to find each path from root to leaf node using Java program. A binary tree is a non-linear data structure type tree with at most two children for each…

Posted in Java

Find All Paths from Root to Leaf Nodes in Binary Tree using Java

Here I am going to show you how to find common, uncommon, unique elements in two Lists or ArrayLists using Java program. In this program I will show you how to find common, uncommon, unique string elements as well as object elements in two ArrayLists. For identifying the unique string elements is very straight forward…

Posted in Java

How to find Common, Uncommon, Unique Elements in Two ArrayLists using Java

Introduction In this tutorial I am going to show you how to create a custom immutable class in Java programming language. Immutable objects are those objects whose states cannot be changed. For example, you can change the state of an object by changing its attribute’s or field’s value. String is an example of the immutable…

Posted in Java

How to create Custom Immutable Class in Java

In this tutorial I am going to discuss about what is Whitelabel Error Page and how to deal with Whitelabel Error Page in Spring Boot applications. Spring boot allows you to setup a Spring based application with minimal configurations. Spring MVC applications provide no default (fall-back) error page out of the box but Spring Boot…

Posted in Spring Boot Spring REST

How to deal with Whitelabel Error Page in Spring Boot Applications

Introduction Here I am going to show you an example on CodeIgniter 4 transaction using MySQL database server. You know that transaction is an important part of persistence storage system because you may save, update or delete data from persistence storage any time. When you perform execution of multiple statement across different database or tables…

Posted in Codeigniter MySQL

CodeIgniter 4 Transaction Example

You may want to display popular posts widget in your WordPress site. It serves as a great way to introduce your readers to the most popular contents. The contents you want to show may be posts or pages. Here I am going to show you how you can track and display most popular posts. Having…

Posted in Wordpress

How to display WordPress Popular Posts based on Views

Here I am going to build an application to show how to use Spring Cloud Bus. Let’s say you have multiple applications reading properties using Spring Cloud Config from centralized configuration files (for example, from Git repository). Spring Cloud Config is where you can have not only your all configurations centrally managed but also you…

Posted in Kafka Spring Boot Spring Cloud

Spring Cloud Bus Example