MoveDatasetContent implements BaseUpgradeTaskTo_2_1_0_PE { public boolean haveToBeApply() { File newRootFolder = new File(newRoot); return !newRootFolder.exists(); }  @Value("${content-service.store.local.path}") void setOldRoot(String basePath); @Value("${content-service.store.local.path}") void setTmp(String basePath); @Value("${content-service.store.local.path}") void setNewRoot(String basePath); @Override void run(); boolean haveToBeApply(); @Override int getOrder(); @Override target getTarget();  }
@Test public void testDoNotNeedToApplyUpgrade() throws IOException { Assert.assertTrue(new File(task.oldRoot).exists()); File newRootDirectory = new File(task.newRoot); if (!newRootDirectory.exists()) { FileUtils.forceMkdir(newRootDirectory); Assert.assertTrue(newRootDirectory.exists()); } Assert.assertFalse(task.haveToBeApply()); }
@Test public void testNeedToApplyUpgrade() { Assert.assertTrue(new File(task.oldRoot).exists()); Assert.assertFalse(new File(task.newRoot).exists()); Assert.assertTrue(task.haveToBeApply()); }