AsyncRequestFetcherBean implements AsyncRequestFetcher { @Override public AsyncRequest getAsyncRequest(String requestId) throws AsyncRequestNotFoundException { AsyncRequest request = asyncRequestDaoBean.findById(requestId); if (request != null) { return request; } else { logger.debug("Asynchronous request at " + requestId + " does not exist"); throw new AsyncRequestNotFoundException("Asynchronous request does not exist."); } }  @Override AsyncRequest getAsyncRequest(String requestId); @Override @SuppressWarnings("unchecked") AsyncRequestResult getAsyncRequestOKResultByRequestedUrl(String requestedUrl); @Override String getAsyncRequestInProgressIdByRequestedUrl(String requestedUrl); @Override AsyncRequestResult getAsyncRequestResult(String resultId); @Override AsyncRequestResult getAsyncRequestResultByRequestedUrl(String requestedUrl);  }
@Test(expected = AsyncRequestNotFoundException.class) public void shouldGetAsyncRequestNotFoundException() throws Exception { asyncRequestFetcher.getAsyncRequest("null"); }