In this post, under Spring Retry I will show with example how to configure FixedBackOfPolicy using annotations. For our example we will use the below service class Service class 1 import java.util.Date; 2 3 import org.springframework.retry.annotation.Backoff; 4 import org.springframework.retry.annotation.Retryable; 5 import org.springframework.stereotype.Service; 6 7 @Service 8 public class Service13 { 9 private int i =…… Continue reading Configuring FixedBackOfPolicy (using annotations)
Month: July 2022
Configuring maxAttempts for Retry (using annotations)
In this post under Spring Retry, I will explain with example on how to configure maxAttempts for retry operation using annotation. For our example, we will use the below Service class Service Class 1 import org.springframework.retry.annotation.Retryable; 2 import org.springframework.stereotype.Service; 3 4 @Service 5 public class Service12 { 6 private int i = 0; 7 8…… Continue reading Configuring maxAttempts for Retry (using annotations)
AssertThrows example
In this post under Junit 5, I will show with example what is the purpose of and how to use AssertThrows feature. AssertThrows method checks whether the called method throws the user specified exception or not. If the user specified exception is thrown, the test passes otherwise the test fails. For our example, we will…… Continue reading AssertThrows example
Configuring StatisticsListener (using annotations)
In this post under Spring Retry, I will show with example how to configure StatisticsListener using annotations. As explained in previous posts, StatisticsListener class provided by Spring Retry framework collects statistics of a particular retry operations. The statistics information involves1) Abort Count –> How many times the retry was aborted2) Complete Count –> How many…… Continue reading Configuring StatisticsListener (using annotations)
Assertions using Supplier interface
In this post under JUnit 5, I will show with example, the new version of assert method which takes a Supplier interface implementation as an argument. In previous versions of JUnit, we have seen variety of assert methods, which takes the below arguments.1) The expected value (optional)2) The actual value (required)3) String message when the…… Continue reading Assertions using Supplier interface