### Question:
CamundaRequestHandler { public ResponseEntity<List<HistoricProcessInstanceEntity>> getCamundaProcessInstanceHistory(String requestId, boolean retry, boolean activeOnly, boolean sort) { String targetUrl = buildCamundaUrlString(true, sort, activeOnly, requestId); HttpHeaders headers = setCamundaHeaders(env.getRequiredProperty("mso.camundaAuth"), env.getRequiredProperty("mso.msoKey")); HttpEntity<?> requestEntity = new HttpEntity<>(headers); if (retry) { RestTemplate restTemplate = getRestTemplate(retry); RetryTemplate retryTemplate = getRetryTemplate(); return retryTemplate.execute(context -> { if (context.getLastThrowable() != null) { logger.error("Retrying: Last call resulted in exception: ", context.getLastThrowable()); } if (context.getRetryCount() == 0) { logger.info("Querying Camunda for process-instance history for requestId: {}", requestId); } else { logger.info( "Retry: Querying Camunda for process-instance history for retryCount: {} and requestId: {}", context.getRetryCount(), requestId); } return restTemplate.exchange(targetUrl, HttpMethod.GET, requestEntity, new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {}); }); } else { RestTemplate restTemplate = getRestTemplate(retry); return restTemplate.exchange(targetUrl, HttpMethod.GET, requestEntity, new ParameterizedTypeReference<List<HistoricProcessInstanceEntity>>() {}); } }  ResponseEntity<List<HistoricProcessInstanceEntity>> getCamundaProcessInstanceHistory(String requestId,
            boolean retry, boolean activeOnly, boolean sort);  }### Answer:
@Test public void timeoutTest() { wireMockServer.stubFor(get( ("/sobpmnengine/history/process-instance?processInstanceBusinessKey=6718de35-b9a5-4670-b19f-a0f4ac22bfaf&active=true&maxResults=1")) .willReturn(aResponse().withHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON) .withBodyFile("Camunda/HistoryCheckResponse.json") .withStatus(org.apache.http.HttpStatus.SC_OK).withFixedDelay(40000))); thrown.expect(ResourceAccessException.class); camundaRequestHandler.getCamundaProcessInstanceHistory("6718de35-b9a5-4670-b19f-a0f4ac22bfaf", false, true, false); }