GitForkBranch { public String getBranchName() { if (this.imageTag == null || this.imageTag.trim().isEmpty()) { return this.branchPrefix; } else { return this.branchPrefix + "-" + this.imageTag; } } GitForkBranch(String imageName, String imageTag, String specifiedBranch); boolean isSameBranchOrHasImageNamePrefix(String branchName); boolean useSpecifiedBranchOverride(); String getBranchName(); String getImageName(); String getImageTag();  }
@Test(dataProvider = "imageNameAndExpectedBranch") public void testGetBranchNameForImageTagCombos(String imageName, String imageTag, String expectedResult) { assertEquals(new GitForkBranch(imageName, imageTag, "").getBranchName(), expectedResult); }
@Test(dataProvider = "imageNameAndSpecifiedBranches") public void testGetBranchNameForImageSpecifiedBranchCombos(String imageName, String imageTag, String specifiedBranch, String expectedResult) { assertEquals(new GitForkBranch(imageName, imageTag, specifiedBranch).getBranchName(), expectedResult); }