Tag: java

  • Testcontainers in Java Spring Boot 

    Testcontainers is an open source framework for providing throwaway, lightweight instances of databases, message brokers, web browsers, or just about anything that can run in a Docker container.(1) In this blog post , we will utilize Testcontainers for testing a Java Spring Boot application integrated with a Postgres database. To run Testcontainers-based tests, you need…

  • Spring Boot Test – JUnit5&Mockito

    In this article, we’re going to dive into the spring-boot-starter-test dependency that’s used for writing tests in Spring Boot projects. We’ll go over the important libraries included in this dependency, with a focus on JUnit and Mockito, and even provide some sample codes related to these libraries. spring-boot-starter-test dependency includes the following important libraries: -JUnit-Spring…

  • Spring Data Redis Cache – Redis-CLI

    In this article, I will provide an example of how to use PostgreSQL as a database and Redis for caching in a Spring Boot project. We will be using Docker Compose to install these tools. First, let’s understand what Redis is, its purpose, and its advantages. After that, we’ll discuss the methods in the provided…

  • Elasticsearch and Kibana with Docker Compose – Spring Boot Example

    Docker, a popular containerization platform, provides an excellent solution for distributing and managing software applications quickly. Docker Compose, a powerful tool, is used to orchestrate the simultaneous operation of multiple containers. Elasticsearch is a robust search and analytics engine with powerful capabilities for indexing, querying, and analyzing data. Kibana, an open-source tool, complements Elasticsearch by…

  • Authentication and Authorization with Spring Security – JWT

    Spring Security is a security framework that provides a wide range of security capabilities for Java-based applications. It offers support for multiple authentication mechanisms like username/password, LDAP, OAuth, and OpenID Connect. This allows for the verification of user credentials in different ways. In addition to authentication, Spring Security also has a powerful authorization system that…

  • Spring Boot – Messaging with RabbitMQ

    The microservices architecture is an important aspect of modern application development. It involves breaking down the application into small, independent services, with each running as a separate microservice. However, enabling data and information exchange between these small services can be a challenging.Spring Boot facilitates fast and efficient development of microservices. In this article, we will…

  • Spring Annotations: @Component vs. @Bean – Best Practices

    The annotations @Component and @Bean are both essential in defining and managing beans in Spring applications. When I first started learning Spring Boot, I found it difficult to understand when to use these two annotations. Now, I want to share what I have learned. But first, let’s talk briefly about Spring Boot. What is Spring…

  • Object-Oriented Concepts: Associaton, Aggregation, Composition and Inheritance

    This blog post aims to explain object-oriented programming concepts and the distinctions between relationship types like association, aggregation, and composition. It also delves into the comparison between inheritance and composition. Relationship Types I utilized UML diagrams to visually represent object-oriented programming concepts. 1. Association Association describes the relationship between classes where objects of one class…