Categories
Java Kotlin Spring

Spring Boot Swagger documentation using OpenAPI

Rich API documentation is a vital element of any successful project, especially if it has to be integrated by third parties. Unfortunately, Spring Boot does not have an out-of-the-box solution for Swagger documentation. So we must use a third-party library (Springdoc-openapi) for that purpose. In this article, we cover how to add Spring Boot Swagger […]

Categories
Kotlin Spring

Spring Boot Redis integration test with Testcontainers in Kotlin

Like any other external dependency, we can write integration tests using Testcontainers for a Spring Boot application. However, unfortunately, Testcontainers does not have any library for Redis, and using Kotlin makes it even trickier. In this article, we explore how to write Spring Boot Redis integration test with Testcontainers in Kotlin. Introduction There are two […]

Categories
Kotlin Spring

How to handle MethodArgumentNotValidException in Spring Boot

Error handling in Spring Boot is simple, easy, and efficient. Yet it can be daunting sometimes as different types of validation exceptions and annotations are supported by the Spring framework. In this tutorial, we go over how to handle MethodArgumentNotValidException in Spring Boot. Additionally, we discuss a similar exception known as ConstraintViolationException and highlight the […]

Categories
Spring

How to use alternative serializers instead of Jackson with Spring Boot

Spring Boot relies on the Jackson library as its default serializer and deserializer for objects. Jackson is included as a transitive dependency in the spring-boot-starter-web package. However, there may be cases where using a different serializer is preferred. This article guides how to use alternative serializers instead of Jackson with Spring Boot, allowing you to […]

Categories
MySQL Spring

Spring Boot MySQL integration tests with Testcontainers

When it comes to writing database integration tests with Spring Boot, there are two options: an in-memory database or Testcontaienrs. As we already covered Testing Spring Data Repositories with H2 in-memory database, we shift the gear in this article and focus on writing Spring Boot MySQL integration tests with Testcontainers. Introduction Although utilizing an in-memory […]

Categories
Spring

Database migration with Spring Boot and Flyway

Database migration or schema evolution is inevitable in any long-lasting project. While NoSQL databases give more leeway, relational databases are pretty rigid regarding schema evolution. Hence, having a suitable tool at your disposal saves you time and energy. Spring Boot not only eases working with databases by providing an abstract layer known at repositories but […]

Exit mobile version