@Test
public void testExceptionFromGetSha1OrNull_inResume() throws B2Exception, IOException {

    // arrange to throw when asked for the sha1.
    when(contentSource.getSha1OrNull()).thenThrow(new IOException("testing"));
    final B2FileVersion version = new B2FileVersion(fileId(1),
            fileName(1),
            contentSource.getContentLength(),
            B2ContentTypes.B2_AUTO,
            null,
            null,
            B2Collections.mapOf(),
            "upload",
            123L);
    recordingListener.setExpected(); // no progress because threw before starting uploads.
    thrown.expect(B2LocalException.class);
    thrown.expectMessage("failed to get large file's sha1: java.io.IOException: testing");
    makeUploader(contentSource, recordingListener).finishUploadingLargeFile(version, B2Collections.listOf());
}