mirror of
https://github.com/octoleo/plantuml-server.git
synced 2025-01-23 13:58:24 +00:00
Consume the http response to avoid IO exception
This commit is contained in:
parent
a0c3fbe525
commit
f34d9ca34e
@ -57,6 +57,10 @@ public class TestImage extends WebappTestCase {
|
||||
SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss ZZZ", Locale.ENGLISH);
|
||||
Date lastModified = format.parse( response.getHeaderField( "Last-Modified"));
|
||||
assertTrue( "Last-Modified is not in the past", lastModified.before( new Date()));
|
||||
Thread.sleep(500); // Time to receive the image
|
||||
// Consume the response
|
||||
InputStream responseStream = response.getInputStream();
|
||||
while( responseStream.read() != -1) {
|
||||
; // Do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user