From 311ff23b4cce39424eed2d7b3b035cb4274daefa Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Thu, 11 Jan 2018 10:53:05 -0500 Subject: [PATCH] Revert "Fixing config retry test to work with boot 1.5.10" This reverts commit da0aa3b518844ce53c1e6f2da92c67d22d58c4d1. --- .../StandaloneClientApplicationTests.java | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/config-retry/src/test/java/demo/StandaloneClientApplicationTests.java b/config-retry/src/test/java/demo/StandaloneClientApplicationTests.java index 37cb090..2b61b4e 100644 --- a/config-retry/src/test/java/demo/StandaloneClientApplicationTests.java +++ b/config-retry/src/test/java/demo/StandaloneClientApplicationTests.java @@ -2,7 +2,6 @@ package demo; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; import java.lang.reflect.Method; import java.util.Map; @@ -72,23 +71,10 @@ public class StandaloneClientApplicationTests { @SuppressWarnings("unchecked") Map delegates = (Map) ReflectionTestUtils .getField(advice, "delegates"); - Object obj = delegates + RetryOperationsInterceptor interceptor = (RetryOperationsInterceptor) delegates .values().iterator().next(); - RetryTemplate retryTemplate = null; - if(RetryOperationsInterceptor.class.isInstance(obj)) { - //Prior to Boot 1.5.10 - RetryOperationsInterceptor interceptor = (RetryOperationsInterceptor)obj; - retryTemplate = (RetryTemplate) ReflectionTestUtils.getField( - interceptor, "retryOperations"); - } else if(Map.class.isInstance(obj)) { - //Boot 1.5.10 and later - Object[] methodInterceptors = ((Map)obj).values().toArray(); - RetryOperationsInterceptor interceptor = (RetryOperationsInterceptor)methodInterceptors[1]; - retryTemplate = (RetryTemplate)ReflectionTestUtils.getField( - interceptor, "retryOperations");; - } else { - fail("Could not find RetryTemplate"); - } + RetryTemplate retryTemplate = (RetryTemplate) ReflectionTestUtils.getField( + interceptor, "retryOperations"); ExponentialBackOffPolicy backoff = (ExponentialBackOffPolicy) ReflectionTestUtils .getField(retryTemplate, "backOffPolicy"); assertEquals(3000, backoff.getInitialInterval());