Commit 5036fc50 authored by Andy Wilkinson's avatar Andy Wilkinson

Merge branch '1.5.x'

parents 357b9d66 29adf2d8
...@@ -18,6 +18,7 @@ package sample.integration.consumer; ...@@ -18,6 +18,7 @@ package sample.integration.consumer;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.concurrent.Future; import java.util.concurrent.Future;
...@@ -57,13 +58,7 @@ public class SampleIntegrationApplicationTests { ...@@ -57,13 +58,7 @@ public class SampleIntegrationApplicationTests {
private void deleteIfExists(File directory) throws InterruptedException { private void deleteIfExists(File directory) throws InterruptedException {
if (directory.exists()) { if (directory.exists()) {
for (int i = 0; i < 10; i++) { assertThat(FileSystemUtils.deleteRecursively(directory)).isTrue();
if (FileSystemUtils.deleteRecursively(directory)) {
return;
}
Thread.sleep(500);
}
throw new IllegalStateException("Failed to delete '" + directory + "'");
} }
} }
...@@ -102,8 +97,14 @@ public class SampleIntegrationApplicationTests { ...@@ -102,8 +97,14 @@ public class SampleIntegrationApplicationTests {
} }
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
for (Resource resource : resources) { for (Resource resource : resources) {
builder.append(new String(StreamUtils InputStream inputStream = resource.getInputStream();
.copyToByteArray(resource.getInputStream()))); try {
builder.append(new String(
StreamUtils.copyToByteArray(inputStream)));
}
finally {
inputStream.close();
}
} }
return builder.toString(); return builder.toString();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment