Test that temp file has been deleted before triggering heap dump

The MBean requires that a file does not exist at the location to which
it’s dumping the heap. This commit updates the test to ensure that the
temporary file that’s created to get a location for the heap dump file
is deleted before asking the MBean to dump the heap to that location.
pull/6414/merge
Andy Wilkinson 8 years ago
parent fbf291ee12
commit fe22609096

@ -152,6 +152,9 @@ public class HeapdumpMvcEndpointTests {
if (TestHeapdumpMvcEndpoint.this.locked) {
throw new InterruptedException();
}
if (file.exists()) {
throw new IOException("File exists");
}
FileCopyUtils.copy(TestHeapdumpMvcEndpoint.this.heapDump.getBytes(),
file);
}

Loading…
Cancel
Save