if (StringUtils.isSet(foundStubResponse.getLatency())) {
try {
final long latency = Long.parseLong(foundStubResponse.getLatency());
TimeUnit.MILLISECONDS.sleep(latency);
} catch (final InterruptedException e) {
throw new Stubby4JException(e);
}
}
response.setStatus(Integer.parseInt(foundStubResponse.getStatus()));
response.setHeader(HttpHeaders.LOCATION, foundStubResponse.getHeaders().get("location"));