Created
August 29, 2020 10:09
-
-
Save iainporter/2ac43c8419e8143ea4a21d3d4e4536e4 to your computer and use it in GitHub Desktop.
RollbackMovesFileToFailed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void rollbackMovesFileToFailed() throws Exception { | |
final CountDownLatch stopLatch = new CountDownLatch(1); | |
filePollingChannel.addInterceptor(new ChannelInterceptor() { | |
@Override | |
public Message<?> preSend(Message<?> message, MessageChannel channel) { | |
stopLatch.countDown(); | |
throw new RuntimeException("Forcing an Exception to trigger rollback"); | |
} | |
}); | |
copy(TestUtils.locateClasspathResource(TestUtils.FILE_FIXTURE_PATH), new File(inboundReadDirectory, TestUtils.FILE_FIXTURE_NAME )); | |
assertThat(stopLatch.await(5, TimeUnit.SECONDS), is(true)); | |
assertThatDirectoryIsEmpty(inboundReadDirectory); | |
assertThatDirectoryIsEmpty(inboundProcessedDirectory); | |
assertThatDirectoryIsEmpty(inboundOutDirectory); | |
assertThatDirectoryHasFiles(inboundFailedDirectory, 1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment