String id = uploadFile(new File("test-files/sample.txt"));
log.info("File uploaded");
RepositoryHttpPlayer player = getRepository()
.findRepositoryItemById(id).createRepositoryHttpPlayer();
player.setAutoTerminationTimeout(1000);
RestTemplate template = getRestTemplate();
assertEquals(HttpStatus.OK,
template.getForEntity(player.getURL(), byte[].class)
.getStatusCode());
log.info("Request 1 Passed");
Thread.sleep(300);
assertEquals(HttpStatus.OK,
template.getForEntity(player.getURL(), byte[].class)
.getStatusCode());
log.info("Request 2 Passed");
Thread.sleep(1500);
assertEquals(HttpStatus.NOT_FOUND,
template.getForEntity(player.getURL(), byte[].class)
.getStatusCode());
log.info("Request 3 Passed");
}