@Override public Object getAsyncResult(long timeToWait) { if (this.mockRequest.getAsyncContext() != null && timeToWait == -1) { long requestTimeout = this.mockRequest.getAsyncContext().getTimeout(); timeToWait = requestTimeout == -1 ? Long.MAX_VALUE : requestTimeout; } if (!awaitAsyncDispatch(timeToWait)) { throw new IllegalStateException("Async result for handler [" + this.handler + "]" + " was not set during the specified timeToWait=" + timeToWait); } Object result = this.asyncResult.get(); Assert.state(result != RESULT_NONE, () -> "Async result for handler [" + this.handler + "] was not set"); return this.asyncResult.get(); }
@Override public Object getAsyncResult(long timeToWait) { if (this.mockRequest.getAsyncContext() != null && timeToWait == -1) { long requestTimeout = this.mockRequest.getAsyncContext().getTimeout(); timeToWait = requestTimeout == -1 ? Long.MAX_VALUE : requestTimeout; } if (!awaitAsyncDispatch(timeToWait)) { throw new IllegalStateException("Async result for handler [" + this.handler + "]" + " was not set during the specified timeToWait=" + timeToWait); } Object result = this.asyncResult.get(); Assert.state(result != RESULT_NONE, () -> "Async result for handler [" + this.handler + "] was not set"); return this.asyncResult.get(); }
@Override public Object getAsyncResult(long timeToWait) { if (this.mockRequest.getAsyncContext() != null) { timeToWait = (timeToWait == -1 ? this.mockRequest.getAsyncContext().getTimeout() : timeToWait); } if (!awaitAsyncDispatch(timeToWait)) { throw new IllegalStateException("Async result for handler [" + this.handler + "]" + " was not set during the specified timeToWait=" + timeToWait); } Object result = this.asyncResult.get(); if (result == RESULT_NONE) { throw new IllegalStateException("Async result for handler [" + this.handler + "] was not set"); } return this.asyncResult.get(); }