-
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.
- Loading branch information
Showing
7 changed files
with
196 additions
and
24 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
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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package io.ivyteam.devops.branch; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import java.util.Date; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
class TestBranch { | ||
|
||
private static final Date NOW = new Date(); | ||
|
||
private static final Branch BRANCH = Branch.create() | ||
.lastCommitAuthor("alex") | ||
.protectedBranch(false) | ||
.name("test-alex") | ||
.repository("axonivy/test") | ||
.authoredDate(NOW) | ||
.build(); | ||
|
||
@Test | ||
void name() { | ||
assertThat(BRANCH.name()).isEqualTo("test-alex"); | ||
} | ||
|
||
@Test | ||
void repository() { | ||
assertThat(BRANCH.repository()).isEqualTo("axonivy/test"); | ||
} | ||
|
||
@Test | ||
void lastCommitAuthor() { | ||
assertThat(BRANCH.lastCommitAuthor()).isEqualTo("alex"); | ||
} | ||
|
||
@Test | ||
void authoredDate() { | ||
assertThat(BRANCH.authoredDate()).isEqualTo(NOW); | ||
} | ||
|
||
@Test | ||
void protectedBranch() { | ||
assertThat(BRANCH.protectedBranch()).isFalse(); | ||
} | ||
|
||
@Test | ||
void repoLink() { | ||
assertThat(BRANCH.repoLink()).isEqualTo("/repository/axonivy/test"); | ||
} | ||
|
||
@Test | ||
void ghRepoLink() { | ||
assertThat(BRANCH.ghRepoLink()).isEqualTo("https://github.com/axonivy/test"); | ||
} | ||
|
||
@Test | ||
void ghLink() { | ||
assertThat(BRANCH.ghLink()).isEqualTo("https://github.com/axonivy/test/tree/test-alex"); | ||
} | ||
} |
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
41 changes: 41 additions & 0 deletions
41
src/test/java/io/ivyteam/devops/pullrequest/TestPullRequest.java
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package io.ivyteam.devops.pullrequest; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
class TestPullRequest { | ||
|
||
private static final PullRequest PR = PullRequest.create() | ||
.title("PR-1") | ||
.user("alex") | ||
.repository("axonivy/test") | ||
.id(1) | ||
.branchName("master") | ||
.build(); | ||
|
||
@Test | ||
void title() { | ||
assertThat(PR.title()).isEqualTo("PR-1"); | ||
} | ||
|
||
@Test | ||
void user() { | ||
assertThat(PR.user()).isEqualTo("alex"); | ||
} | ||
|
||
@Test | ||
void repository() { | ||
assertThat(PR.repository()).isEqualTo("axonivy/test"); | ||
} | ||
|
||
@Test | ||
void id() { | ||
assertThat(PR.id()).isEqualTo(1); | ||
} | ||
|
||
@Test | ||
void branchName() { | ||
assertThat(PR.branchName()).isEqualTo("master"); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package io.ivyteam.devops.repo; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
class TestRepo { | ||
|
||
private static final Repo REPO = Repo.create() | ||
.name("dummy/abc") | ||
.codeOfConduct("code of conduct") | ||
.deleteBranchOnMerge(true) | ||
.fork(false) | ||
.isVulnAlertOn(true) | ||
.license("lic") | ||
.issues(false) | ||
.privateRepo(false) | ||
.archived(false) | ||
.securityMd("security md") | ||
.build(); | ||
|
||
@Test | ||
void name() { | ||
assertThat(REPO.name()).isEqualTo("dummy/abc"); | ||
} | ||
|
||
@Test | ||
void codeOfConduct() { | ||
assertThat(REPO.codeOfConduct()).isEqualTo("code of conduct"); | ||
} | ||
|
||
@Test | ||
void deleteBranchOnMerge() { | ||
assertThat(REPO.deleteBranchOnMerge()).isTrue(); | ||
} | ||
|
||
@Test | ||
void fork() { | ||
assertThat(REPO.fork()).isFalse(); | ||
} | ||
|
||
@Test | ||
void isVulnAlertOn() { | ||
assertThat(REPO.isVulnAlertOn()).isTrue(); | ||
} | ||
|
||
@Test | ||
void license() { | ||
assertThat(REPO.license()).isEqualTo("lic"); | ||
} | ||
|
||
@Test | ||
void issues() { | ||
assertThat(REPO.issues()).isFalse(); | ||
} | ||
|
||
@Test | ||
void privateRepo() { | ||
assertThat(REPO.privateRepo()).isFalse(); | ||
} | ||
|
||
@Test | ||
void archived() { | ||
assertThat(REPO.archived()).isFalse(); | ||
} | ||
|
||
@Test | ||
void securityMd() { | ||
assertThat(REPO.securityMd()).isEqualTo("security md"); | ||
} | ||
} |