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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user