### Question:
B2UploadUrlCache { B2UploadUrlResponse get(String bucketId, boolean isRetry) throws B2Exception { if (!isRetry) { synchronized (this) { Deque<B2UploadUrlResponse> responses = perBucket.get(bucketId); if (responses != null) { B2UploadUrlResponse response = responses.pollFirst(); if (response != null) { return response; } } } } final B2GetUploadUrlRequest request = B2GetUploadUrlRequest.builder(bucketId).build(); return webifier.getUploadUrl(accountAuthCache.get(), request); } B2UploadUrlCache(B2StorageClientWebifier webifier,
                     B2AccountAuthorizationCache accountAuthCache);   }### Answer:
@Test public void testExceptionFromAuthCache() throws B2Exception { final B2Exception e = new B2InternalErrorException("testing", "testing message"); doThrow(e).when(authCache).get(); thrown.expect(B2InternalErrorException.class); thrown.expectMessage("testing message"); uploadCache.get(bucketId(1), false); }
@Test public void testExceptionFromWebifier() throws B2Exception { final B2Exception e = new B2InternalErrorException("testing", "testing message"); doThrow(e).when(webifier).getUploadUrl(anyObject(), anyObject()); thrown.expect(B2InternalErrorException.class); thrown.expectMessage("testing message"); uploadCache.get(bucketId(1), false); }