diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapaterParserTests-context-fail-autocreate.xml b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapaterParserTests-context-fail-autocreate.xml new file mode 100644 index 0000000000..4a3b551b7f --- /dev/null +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapaterParserTests-context-fail-autocreate.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapaterParserTests.java b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapaterParserTests.java index 58a75eb6b3..299f8dca09 100644 --- a/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapaterParserTests.java +++ b/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/config/InboundChannelAdapaterParserTests.java @@ -62,7 +62,7 @@ public class InboundChannelAdapaterParserTests { @Test(expected=BeanDefinitionStoreException.class) //exactly one of 'filename-pattern' or 'filter' is allowed on SFTP inbound adapter - public void testLocalFilesAutoCreationFalse() throws Exception{ + public void testFailWithFilePatternAndFilter() throws Exception{ assertTrue(!new File("target/bar").exists()); new ClassPathXmlApplicationContext("InboundChannelAdapaterParserTests-context-fail.xml", this.getClass()); } @@ -81,6 +81,11 @@ public class InboundChannelAdapaterParserTests { assertTrue(new File("foo").exists()); } + @Test(expected=BeanCreationException.class) + public void testLocalDirAutoCreateFailed() throws Exception{ + new ClassPathXmlApplicationContext("InboundChannelAdapaterParserTests-context-fail-autocreate.xml", this.getClass()); + } + @After public void cleanUp() throws Exception{ new File("foo").delete();