Browse Source

Fix test

pull/267/merge
Dave Syer 7 years ago
parent
commit
d0e56d2201
  1. 5
      spring-cloud-commons/src/test/java/org/springframework/cloud/commons/httpclient/DefaultApacheHttpClientConnectionManagerFactoryTests.java

5
spring-cloud-commons/src/test/java/org/springframework/cloud/commons/httpclient/DefaultApacheHttpClientConnectionManagerFactoryTests.java

@ -23,7 +23,7 @@ public class DefaultApacheHttpClientConnectionManagerFactoryTests { @@ -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 { @@ -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> T getField(Object target, String name) {
Field field = ReflectionUtils.findField(target.getClass(), name);
ReflectionUtils.makeAccessible(field);

Loading…
Cancel
Save