Skip to content
Permalink
Browse files
[JENKINS-47909] Migration test.
  • Loading branch information
jglick committed Nov 9, 2017
1 parent b675122 commit e2d36820da22b734f1bce92545a950ab97d39f8d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
@@ -813,6 +813,18 @@ public void emptyUsernameConfigMigrated() {
assertThat(empty.getFullName(), equalTo("Empty"));
}

@Issue("JENKINS-47909")
@LocalData
@Test
public void shellyUsernameMigrated() {
File rootDir = new File(Jenkins.getInstance().getRootDir(), "users");
User user = User.getById("bla$phem.us", false);
assertCorrectConfig(user, "users/bla$0024phem.us/config.xml");
assertFalse(new File(rootDir, "bla$phem.us").exists());
assertTrue(user.getConfigFile().getFile().exists());
assertThat(user.getFullName(), equalTo("Weird Username"));
}

private static void assertCorrectConfig(User user, String unixPath) {
assertThat(user.getConfigFile().getFile().getPath(), endsWith(unixPath.replace('/', File.separatorChar)));
}
Binary file not shown.

0 comments on commit e2d3682

Please sign in to comment.