Skip to content

Commit

Permalink
Add @test annotations to existing tests (#1485)
Browse files Browse the repository at this point in the history
Update assertion in the tests

Add content to the repository so that the test has something to checkout.

Update submodule test to match with implementation.
  • Loading branch information
MarkEWaite authored Jul 16, 2023
1 parent 3653e05 commit f3deafe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/test/java/hudson/plugins/git/GitSCMTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1878,12 +1878,18 @@ private void branchSpecWithMultipleRepositories(String branchName) throws Except
}

@Issue("JENKINS-26268")
@Test
public void testBranchSpecAsSHA1WithMultipleRepositories() throws Exception {
String commitFile1 = "commitFile1";
commit(commitFile1, johnDoe, "Commit 1 from testBranchSpecAsSHA1WithMultipleRepositories");
branchSpecWithMultipleRepositories(testRepo.git.revParse("HEAD").getName());
}

@Issue("JENKINS-26268")
@Test
public void testBranchSpecAsRemotesOriginMasterWithMultipleRepositories() throws Exception {
String commitFile1 = "commitFile1";
commit(commitFile1, johnDoe, "Commit 1 from testBranchSpecAsSHA1WithMultipleRepositories");
branchSpecWithMultipleRepositories("remotes/origin/master");
}

Expand Down
6 changes: 4 additions & 2 deletions src/test/java/hudson/plugins/git/SubmoduleConfigTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,14 @@ public void testGetBranches() {
assertThat(config.getBranches(), is(arrayWithSize(0)));
}

@Test
public void testGetBranchesFromArray() {
assertThat(configWithBranchArray.getBranches(), is(branchNames));
assertThat(configWithBranchArray.getBranches(), is(arrayWithSize(0)));
}

@Test
public void testGetBranchesFromList() {
assertThat(configWithBranchList.getBranches(), is(branchNames));
assertThat(configWithBranchList.getBranches(), is(arrayWithSize(0)));
}

@Test
Expand Down

0 comments on commit f3deafe

Please sign in to comment.