diff --git a/spring-all/src/test/java/org/baeldung/springretry/SpringRetryTest.java b/spring-all/src/test/java/org/baeldung/springretry/SpringRetryTest.java index 52f59dc49a..2f3411957e 100644 --- a/spring-all/src/test/java/org/baeldung/springretry/SpringRetryTest.java +++ b/spring-all/src/test/java/org/baeldung/springretry/SpringRetryTest.java @@ -1,17 +1,15 @@ package org.baeldung.springretry; -import java.sql.SQLException; - import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.retry.RetryCallback; -import org.springframework.retry.RetryContext; import org.springframework.retry.support.RetryTemplate; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; +import java.sql.SQLException; + @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = AppConfig.class, loader = AnnotationConfigContextLoader.class) public class SpringRetryTest { @@ -34,12 +32,9 @@ public class SpringRetryTest { @Test(expected = RuntimeException.class) public void givenTemplateRetryService_whenCallWithException_thenRetry() { - retryTemplate.execute(new RetryCallback() { - @Override - public Void doWithRetry(RetryContext arg0) { - myService.templateRetryService(); - return null; - } + retryTemplate.execute(arg0 -> { + myService.templateRetryService(); + return null; }); } }