Moises Macero's Blog

August 4, 2022

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 upgrade

The last upgrades (check the list of additional chapters) introduced some brea...

 •  0 comments  •  flag
Share on Twitter
Published on January 20, 2022 22:00

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...
 •  0 comments  •  flag
Share on Twitter
Published on October 14, 2021 22:00

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 ...

 •  0 comments  •  flag
Share on Twitter
Published on April 15, 2021 22:00

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...
 •  0 comments  •  flag
Share on Twitter
Published on March 18, 2021 22:00

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...

 •  0 comments  •  flag
Share on Twitter
Published on February 27, 2021 22:00

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...
 •  0 comments  •  flag
Share on Twitter
Published on February 16, 2021 22:00

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...
 •  0 comments  •  flag
Share on Twitter
Published on February 13, 2021 22:00

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...

 •  0 comments  •  flag
Share on Twitter
Published on December 02, 2020 22:00

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 ...
 •  0 comments  •  flag
Share on Twitter
Published on October 09, 2020 22:00