From d0e56d2201802a32b9d2887eddc7da5061246d30 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Wed, 4 Oct 2017 13:51:03 +0100 Subject: [PATCH] Fix test --- ...DefaultApacheHttpClientConnectionManagerFactoryTests.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-cloud-commons/src/test/java/org/springframework/cloud/commons/httpclient/DefaultApacheHttpClientConnectionManagerFactoryTests.java b/spring-cloud-commons/src/test/java/org/springframework/cloud/commons/httpclient/DefaultApacheHttpClientConnectionManagerFactoryTests.java index 00355006..8f265eab 100644 --- a/spring-cloud-commons/src/test/java/org/springframework/cloud/commons/httpclient/DefaultApacheHttpClientConnectionManagerFactoryTests.java +++ b/spring-cloud-commons/src/test/java/org/springframework/cloud/commons/httpclient/DefaultApacheHttpClientConnectionManagerFactoryTests.java @@ -23,7 +23,7 @@ public class DefaultApacheHttpClientConnectionManagerFactoryTests { ((PoolingHttpClientConnectionManager) connectionManager).getMaxTotal()); Object pool = getField(((PoolingHttpClientConnectionManager) connectionManager), "pool"); - assertEquals(-1l, getField(pool, "timeToLive")); + assertEquals(new Long(-1), getField(pool, "timeToLive")); TimeUnit timeUnit = getField(pool, "tunit"); assertEquals(TimeUnit.MILLISECONDS, timeUnit); } @@ -38,11 +38,12 @@ public class DefaultApacheHttpClientConnectionManagerFactoryTests { ((PoolingHttpClientConnectionManager) connectionManager).getMaxTotal()); Object pool = getField(((PoolingHttpClientConnectionManager) connectionManager), "pool"); - assertEquals(56l, getField(pool, "timeToLive")); + assertEquals(new Long(56), getField(pool, "timeToLive")); TimeUnit timeUnit = getField(pool, "tunit"); assertEquals(TimeUnit.DAYS, timeUnit); } + @SuppressWarnings("unchecked") protected T getField(Object target, String name) { Field field = ReflectionUtils.findField(target.getClass(), name); ReflectionUtils.makeAccessible(field);