forked from quarkiverse/quarkus-argocd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Review the code to support the git protocol. quarkiverse#68
Signed-off-by: cmoulliard <[email protected]>
- Loading branch information
1 parent
7a22db3
commit 819f4a4
Showing
3 changed files
with
46 additions
and
15 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
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 |
---|---|---|
|
@@ -5,33 +5,40 @@ | |
|
||
import io.quarkiverse.argocd.deployment.utils.Git; | ||
|
||
public class RepoUrlTest { | ||
public class ScmTest { | ||
|
||
@Test | ||
public void httpsRepository() { | ||
public void HttpProtocolScm() { | ||
String url = "https://github.com/quarkiverse/quarkus-argocd"; | ||
String sanitizedRemoteUrl = Git.sanitizeRemoteUrl(url); | ||
Assertions.assertEquals(url + ".git", sanitizedRemoteUrl); | ||
} | ||
|
||
@Test | ||
public void httpsRepositoryWithSuffixGit() { | ||
public void HttpProtocolScmWithSuffixGit() { | ||
String url = "https://github.com/quarkiverse/quarkus-argocd.git"; | ||
String sanitizedRemoteUrl = Git.sanitizeRemoteUrl(url); | ||
Assertions.assertEquals(url, sanitizedRemoteUrl); | ||
} | ||
|
||
@Test | ||
public void httpsTokenRepository() { | ||
public void HttpProtocolBasicAuthScm() { | ||
String url = "https://[email protected]/quarkiverse/quarkus-argocd.git"; | ||
String sanitizedRemoteUrl = Git.sanitizeRemoteUrl(url); | ||
Assertions.assertEquals("https://github.com/quarkiverse/quarkus-argocd.git", sanitizedRemoteUrl); | ||
} | ||
|
||
@Test | ||
public void httpsTokenRepositoryAndPort() { | ||
public void HttpProtocolBasicAuthScmAndPort() { | ||
String url = "https://[email protected]:8443/quarkus/my-quarkus-hello.git"; | ||
String sanitizedRemoteUrl = Git.sanitizeRemoteUrl(url); | ||
Assertions.assertEquals("https://gitea.cnoe.localtest.me:8443/quarkus/my-quarkus-hello.git", sanitizedRemoteUrl); | ||
} | ||
|
||
@Test | ||
public void GitProtocolRepository() { | ||
String url = "[email protected]:quarkus/my-quarkus-hello.git"; | ||
String sanitizedRemoteUrl = Git.sanitizeRemoteUrl(url); | ||
Assertions.assertEquals("https://gitea.cnoe.localtest.me/quarkus/my-quarkus-hello.git", sanitizedRemoteUrl); | ||
} | ||
} |