Moises Macero's Blog
August 4, 2022
Book's Upgrade: Migrating from Spring Boot 2.6 to 2.7
A new upgrade chapter! This one covers the required changes on the book���s source code to update it to Spring Boot 2.7.1 and some extras.
Table of Contents An H2 major upgrade surprise and some extras Migrate to Spring Boot 2.7 Major H2 upgrade Feature not supported: ���AUTO_SERVER=TRUE && DB_CLOSE_ON_EXIT=FALSE��� Error executing DDL ���create table user ������ Bonus: Migrating bootstrap to application���s properties Remove the legacy bootstrap st...January 20, 2022
Book's Upgrade: Migrating from Spring Boot 2.5 to 2.6
This chapter describes how to upgrade the book���s source code to Spring Boot 2.6.2 and Spring Cloud 2021.0. Good news: a very simple update this time, I didn���t need any changes apart from the version updates.
Table of Contents Good news: a very smooth upgrade Migrate to Spring Boot 2.6.2 and Spring Cloud 2021.0 A minor remark: an annoying stack trace on MacOS SummaryGood news: a very smooth upgradeThe last upgrades (check the list of additional chapters) introduced some brea...
October 14, 2021
Book's Upgrade: Migrating from Spring Boot 2.4 to 2.5
This chapter describes how to upgrade the book���s source code to Spring Boot 2.5.5 and Java 17. No major changes but some parts of the code break, so we need to make some little adjustments here and there. We���ll also learn how to use the new RandomGenerator interface in tests.
Table of Contents No major complications, but the update breaks the code Migrate to Spring Boot 2.5.5 and Java 17 No more spying on Randoms Removing application-default.properties SummaryNo major compl...April 15, 2021
Sending and receiving JSON messages with Spring Boot AMQP and RabbitMQ
Setting up a Hello-World Spring Boot application using AMQP with RabbitMQ is quite easy if you go for the basic setup, as many other guides do. However, the configuration is not so straightforward when you get into the serialization setup and want to make use of @RabbitListener annotations to produce and consume messages in JSON format. Therefore, I���m sharing with you a really simple but more serious approach that those hello-messaging apps, supported with a real-life practical example.
This ...
March 18, 2021
Practical guide: Feature Toggles with Spring Boot and Unleash
In this practical guide, I���ll demonstrate how to use Feature Toggles for different use case scenarios. You���ll learn how to configure your project to use an out-of-the-box feature toggle router: Unleash.
Table of Contents What are feature toggles? Why should you use feature toggles? Development efficiency Minimize risks Optimize conversion rate The practical case Unleash, Feature Toggles as a Service Injecting the Request Context with u...February 27, 2021
Spring Boot and Kafka ��� Practical Example
This blog post shows you how to configure Spring Kafka and Spring Boot to send messages using JSON and receive them in multiple formats: JSON, plain Strings or byte arrays.
This sample application also demonstrates how to use multiple Kafka consumers within the same consumer group with the @KafkaListener annotation, so the messages are load-balanced. Each consumer implements a different deserialization approach.
Besides, at the end of this post, you will find some practical exercises in case y...
February 16, 2021
Cucumber Tests in Spring Boot with Dependency Injection
Cucumber is a great framework to create tests using a BDD approach. Unfortunately, the official website doesn���t provide too much documentation, so it might be tricky to set it up. In this post, I���ll show you how to combine Cucumber with Spring Boot using the cucumber-spring library to leverage Dependency Injection.
Table of Contents The Spring Boot sample project Required Libraries How Cucumber-Spring works Overview Entry Point: @RunWith Cucumber Adding dep...February 13, 2021
How to test a controller in Spring Boot - a practical guide
There are different ways to test your Controller (Web or API Layer) classes in Spring Boot, some provide support to write pure Unit Tests and some others are more useful for Integration Tests. Within this post, I���ll cover the main three test approaches available for Spring: using MockMVC in standalone mode, MockMVC together with SpringRunner, and using SpringBootTest.
Updated (Feb 14th, 2021): Code examples use Java 15 and Spring Boot 2.4 with JUnit 5. Removed explicit SpringExten...December 2, 2020
Book's Code Upgrade: Migrate from Spring Boot 2.3 to 2.4
This chapter describes how to upgrade the book���s source code to Spring Boot 2.4.0, Spring Cloud 2020.0, and Java 15.
Table of Contents A minor update, or not? Migrate to Spring Boot 2.4.0 and Java 15 Embedded Database (H2) credentials Building the apps Migrate to Spring Cloud 2020.0 from Spring Cloud Hoxton Spring Cloud Bootstrap Upgrading the Docker image dependencies A minor update, or not?Moving from Spring Boot 2.3.4 to 2.4.0 means we deal...
October 9, 2020
Using Awaitility with Cucumber for Eventual Consistency checks
The last part of the guide focuses on building end-to-end tests with Cucumber that support eventual consistency. We use the second feature, the Leaderboard, to show how to integrate Awaitility in Cucumber tests with a practical example.
> The Cucumber Java Guide
GitHub
Learn how to build end-to-end tests with Java and Cucumber, using this step-by-step tutorial with practice code examples. This guide ...


