INT-4498: StreamUtils -> FileCopyUtils

JIRA: https://jira.spring.io/browse/INT-4498

* Use `FileCopyUtils` instead of `StreamUtils` in test-cases when we deal
with `InputStream` s and files resources.
* Fix reflection-based tests with AOP to use an `ArrayList` access
instead of `LinkedList` since an optimization in SF:
6d6aa72e8f

**Cherry-pick to 5.0.x and 4.3.x**

(cherry picked from commit a1f016a)
This commit is contained in:
Artem Bilan
2018-07-09 12:41:45 -04:00
parent 2fbb44322c
commit 9fa1c7db38
8 changed files with 28 additions and 23 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -101,7 +101,7 @@ public class RedisOutboundChannelAdapterParserTests extends RedisAvailableTests
assertTrue(AopUtils.isAopProxy(endpointHandler));
assertThat(TestUtils.getPropertyValue(endpointHandler, "h.advised.advisors.first.item.advice"),
assertThat(TestUtils.getPropertyValue(endpointHandler, "h.advised.advisors[0].advice"),
Matchers.instanceOf(RequestHandlerRetryAdvice.class));
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2016 the original author or authors.
* Copyright 2013-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -45,6 +45,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
* @author Artem Bilan
* @author Gary Russell
* @author Rainer Frey
*
* @since 3.0
*/
@ContextConfiguration
@@ -88,15 +89,17 @@ public class RedisQueueOutboundChannelAdapterParserTests {
assertSame(((Advised) handler).getTargetSource().getTarget(), this.defaultAdapter);
assertThat(TestUtils.getPropertyValue(handler, "h.advised.advisors.first.item.advice"),
assertThat(TestUtils.getPropertyValue(handler, "h.advised.advisors[0].advice"),
Matchers.instanceOf(RequestHandlerRetryAdvice.class));
assertTrue(TestUtils.getPropertyValue(this.defaultAdapter, "leftPush", Boolean.class));
}
@Test
public void testInt3017CustomConfig() {
assertSame(this.customRedisConnectionFactory, TestUtils.getPropertyValue(this.customAdapter, "template.connectionFactory"));
assertEquals("headers['redis_queue']", TestUtils.getPropertyValue(this.customAdapter, "queueNameExpression", Expression.class).getExpressionString());
assertSame(this.customRedisConnectionFactory,
TestUtils.getPropertyValue(this.customAdapter, "template.connectionFactory"));
assertEquals("headers['redis_queue']",
TestUtils.getPropertyValue(this.customAdapter, "queueNameExpression.expression"));
assertFalse(TestUtils.getPropertyValue(this.customAdapter, "extractPayload", Boolean.class));
assertTrue(TestUtils.getPropertyValue(this.customAdapter, "serializerExplicitlySet", Boolean.class));
assertSame(this.serializer, TestUtils.getPropertyValue(this.customAdapter, "serializer"));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2007-2017 the original author or authors.
* Copyright 2007-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -75,7 +75,7 @@ public class RedisStoreOutboundChannelAdapterParserTests {
assertSame(((Advised) handler).getTargetSource().getTarget(), withStringTemplate);
assertThat(TestUtils.getPropertyValue(handler, "h.advised.advisors.first.item.advice"),
assertThat(TestUtils.getPropertyValue(handler, "h.advised.advisors[0].advice"),
Matchers.instanceOf(RequestHandlerRetryAdvice.class));
assertEquals("true", TestUtils.getPropertyValue(withStringTemplate, "zsetIncrementScoreExpression",