File dbFile = new File(new File(dryRunCacheLocation, "123"), (String) args[2] + ".h2.db");
FileUtils.write(dbFile, "fake db content 2");
return dbFile;
}
});
when(resourceDao.getRootProjectByComponentId(123L)).thenReturn(new ResourceDto().setId(123L));
byte[] dbContent = dryRunCache.getDatabaseForPreview(123L);
assertThat(new String(dbContent)).isEqualTo("fake db content 1");
// Emulate invalidation of cache