UriProvider extends SavingStreamProvider { @Override protected InputStream stream() throws IOException { InputStream in = new BufferedInputStream(getInputStream(), IO_BUFFER_SIZE); return in; } UriProvider(MirageRequest request);   }
@Test public void testLoads() throws IOException { MirageRequest request = mock(MirageRequest.class); UrlFactory factory = mock(UrlFactory.class); InputStream inputStream = mock(InputStream.class); when(factory.getStream(any(Uri.class))).thenReturn(inputStream); when(request.urlFactory()).thenReturn(factory); UriProvider provider = new UriProvider(request); when(request.provider()).thenReturn(provider); when(request.uri()).thenReturn(Uri.parse("http: InputStream stream = provider.stream(); Assert.assertNotNull(stream); }