expect(vDAO.findByName("MY_VIEW{1.0.0}")).andReturn(null);
expect(vDAO.merge(capture(captureViewEntity))).andReturn(null);
expect(vDAO.findByName("MY_VIEW{1.0.0}")).andReturn(viewDefinition);
expect(vDAO.findAll()).andReturn(Collections.<ViewEntity>emptyList());
// replay mocks
replay(configuration, viewDir, extractedArchiveDir, viewArchive, archiveDir, entryFile, classesDir,
libDir, fileEntry, viewJarFile, enumeration, jarEntry, is, fos, vDAO);