ChangeUserIdToTargetId implements BaseUpgradeTaskTo_1_3_0_PE { @Override public void run() { Path rootFolder = Paths.get(storeLocation); try { Files.walkFileTree(rootFolder, emptySet(), 1, new RenameUserToTarget()); } catch (IOException e) { throw new TDPException(CommonErrorCodes.UNEXPECTED_EXCEPTION, e); } }  @Override int getOrder(); @Override target getTarget(); @Override void run();  }
@Test public void shouldRenameUpgradeUserFolders() throws Exception { List<String> expected = Arrays.asList("USER-chuck norris", "USER-mr anonymous", "USER-william from arcachon", "VERSION-1.3.0"); task.run(); Path rootFolder = Paths.get(storeLocation); List<String> actual = Arrays.asList(rootFolder.toFile().list()); assertTrue(actual.containsAll(expected) && expected.containsAll(actual)); }