Spring @Bean and @Configuration Simple Example

In this post under Spring Core, I will explain with example the purpose of “@Bean” and “@Configuration” annotation. Earlier before the introduction of annotations in Spring project, we used to define beans in xml file. For example if we had a classes as shown below package package1; public class Bean1 { @Override public String toString()…… Continue reading Spring @Bean and @Configuration Simple Example

Changing display name when printing string format of an object

In this post under Lombok, I will show with example, the purpose of “name” attribute in “ToString.Include” annotation. Whenever we use “ToString” annotation on a class, it generates the string format of an object where field name (also can be called as display name) are equal to object property name. So for example if below…… Continue reading Changing display name when printing string format of an object

Communication between host and Container

In this post under TestContainer, I will show with example how to make the host communicate with the docker container. Below is the complete code for your reference. Main Class 1 package package3; 2 3 import org.testcontainers.containers.GenericContainer; 4 import org.testcontainers.utility.DockerImageName; 5 6 public class Example3 { 7 public static void main(String[] args) { 8 DockerImageName…… Continue reading Communication between host and Container