diff --git a/org.springframework.integration.file/src/test/java/org/springframework/integration/file/config/FileOutboundChannelAdapterParserTests-context.xml b/org.springframework.integration.file/src/test/java/org/springframework/integration/file/config/FileOutboundChannelAdapterParserTests-context.xml index 264784f570..300f6d9318 100644 --- a/org.springframework.integration.file/src/test/java/org/springframework/integration/file/config/FileOutboundChannelAdapterParserTests-context.xml +++ b/org.springframework.integration.file/src/test/java/org/springframework/integration/file/config/FileOutboundChannelAdapterParserTests-context.xml @@ -18,12 +18,17 @@ - + + + diff --git a/org.springframework.integration.file/src/test/java/org/springframework/integration/file/config/FileOutboundChannelAdapterParserTests.java b/org.springframework.integration.file/src/test/java/org/springframework/integration/file/config/FileOutboundChannelAdapterParserTests.java index 65fe10afcb..f510fc80c0 100644 --- a/org.springframework.integration.file/src/test/java/org/springframework/integration/file/config/FileOutboundChannelAdapterParserTests.java +++ b/org.springframework.integration.file/src/test/java/org/springframework/integration/file/config/FileOutboundChannelAdapterParserTests.java @@ -49,6 +49,10 @@ public class FileOutboundChannelAdapterParserTests { @Qualifier("adapterWithCustomNameGenerator") EventDrivenConsumer adapterWithCustomNameGenerator; + @Autowired + @Qualifier("adapterWithDeleteFlag") + EventDrivenConsumer adapterWithDeleteFlag; + @Test public void simpleAdapter() { @@ -60,6 +64,7 @@ public class FileOutboundChannelAdapterParserTests { File actual = (File) handlerAccessor.getPropertyValue("destinationDirectory"); assertEquals(expected, actual); assertTrue(handlerAccessor.getPropertyValue("fileNameGenerator") instanceof DefaultFileNameGenerator); + assertEquals(Boolean.FALSE, handlerAccessor.getPropertyValue("deleteSourceFiles")); } @Test @@ -74,4 +79,13 @@ public class FileOutboundChannelAdapterParserTests { assertTrue(handlerAccessor.getPropertyValue("fileNameGenerator") instanceof CustomFileNameGenerator); } + @Test + public void adapterWithDeleteFlag() { + DirectFieldAccessor adapterAccessor = new DirectFieldAccessor(adapterWithDeleteFlag); + FileWritingMessageHandler handler = (FileWritingMessageHandler) + adapterAccessor.getPropertyValue("handler"); + DirectFieldAccessor handlerAccessor = new DirectFieldAccessor(handler); + assertEquals(Boolean.TRUE, handlerAccessor.getPropertyValue("deleteSourceFiles")); + } + }