This repository has been archived by the owner on Sep 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow usernames containing "@" and addind escaping "@" when building …
…URL (#42)
- Loading branch information
1 parent
d065218
commit 39f79ea
Showing
2 changed files
with
11 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,7 +164,7 @@ class GitRepositoryTest extends CpsScriptTestBase { | |
} | ||
|
||
@Test | ||
void shouldManiupulateHttpsUsername() { | ||
void shouldManipulateHttpsUsername() { | ||
String url = "https://[email protected]:443/wcm-io-devops/jenkins-pipeline-library.git" | ||
underTest = new GitRepository(this.script, url) | ||
assertEquals(url, underTest.getUrl()) | ||
|
@@ -176,6 +176,14 @@ class GitRepositoryTest extends CpsScriptTestBase { | |
assertEquals(url, underTest.getUrl()) | ||
} | ||
|
||
@Test | ||
void shouldEscapeAtInUsername() { | ||
String url = "https://username1@[email protected]:443/wcm-io-devops/jenkins-pipeline-library.git" | ||
String expectedUrl = "https://username1%[email protected]:443/wcm-io-devops/jenkins-pipeline-library.git" | ||
underTest = new GitRepository(this.script, url) | ||
assertEquals(expectedUrl, underTest.getUrl()) | ||
} | ||
|
||
@Test(expected = AbortException.class) | ||
void shouldThrowExceptionOnInvalidUrl() { | ||
underTest = new GitRepository(this.script, "") | ||
|