@Test
public void readQRCodeFromDiskIfCacheExists() throws NoSuchAlgorithmException, IOException, WriterException {

    String expectedData = "{\"general\":{},\"admin\":{}}";
    // stubbing cache and bitmap files
    new File(Collect.SETTINGS).mkdirs();
    FileUtils.saveBitmapToFile(QRCodeUtils.generateQRBitMap(expectedData, 100), QR_CODE_FILEPATH);
    FileUtils.write(md5File, getDigest(expectedData.getBytes()));
    // verify that QRCode and md5 cache files exist
    assertTrue(savedQrCodeImage.exists());
    assertTrue(md5File.exists());
    final long lastModifiedQRCode = savedQrCodeImage.lastModified();
    final long lastModifiedCache = md5File.lastModified();
    final GenerationResults generationResults = new GenerationResults();
    generateQrCode(generationResults);
    // assert that files were not modified
    assertEquals(lastModifiedCache, md5File.lastModified());
    assertEquals(lastModifiedQRCode, savedQrCodeImage.lastModified());
    verifyCachedMd5Data(expectedData);
}