@Test
public void testSha1MismatchDuringDownload() {

    final HelperSimulator helper = new HelperSimulator();
    // mangle the bytes so the sha1 doesn't match!
    bytes[0] = (byte) ((bytes[0]+1) % 256);
    final B2ContentOutputStreamWriter writer = B2ContentOutputStreamWriter.builder(helper).build();
    try {
        writer.readContent(makeHeaderWithSha1(), in);
        fail("should've thrown!");
    } catch (B2Exception e) {
        assertTrue(e.getMessage().startsWith("sha1 mismatch from network."));
    }
    helper.check(
            1,
            0,
            0,
            1
    );
}