### Question:
FetchDataInterceptor implements Interceptor.Fetch { @Override public long interceptFetch(DownloadChain chain) throws IOException { if (chain.getCache().isInterrupt()) { throw InterruptException.SIGNAL; } OkDownload.with().downloadStrategy().inspectNetworkOnWifi(chain.getTask()); int fetchLength = inputStream.read(readBuffer); if (fetchLength == -1) { return fetchLength; } outputStream.write(blockIndex, readBuffer, fetchLength); chain.increaseCallbackBytes(fetchLength); if (this.dispatcher.isFetchProcessMoment(task)) { chain.flushNoCallbackIncreaseBytes(); } return fetchLength; } FetchDataInterceptor(int blockIndex,
                                @NonNull InputStream inputStream,
                                @NonNull MultiPointOutputStream outputStream,
                                DownloadTask task); @Override long interceptFetch(DownloadChain chain);  }### Answer:
@Test public void interceptFetch() throws IOException { final CallbackDispatcher dispatcher = OkDownload.with().callbackDispatcher(); doReturn(10).when(inputStream).read(any(byte[].class)); doReturn(true).when(dispatcher).isFetchProcessMoment(task); interceptor.interceptFetch(chain); final DownloadStrategy downloadStrategy = OkDownload.with().downloadStrategy(); verify(downloadStrategy).inspectNetworkOnWifi(eq(task)); verify(chain).increaseCallbackBytes(10L); verify(chain).flushNoCallbackIncreaseBytes(); verify(outputStream).write(eq(0), any(byte[].class), eq(10)); }