GitForkBranch { public boolean isSameBranchOrHasImageNamePrefix(String branchName) { if (this.imageTag.equals("")) { return this.getBranchName().equals(branchName); } else if (branchName != null) { String tempBranchName = branchName.trim(); return getBranchWithoutTag(tempBranchName).equals(this.branchPrefix); } return false; } GitForkBranch(String imageName, String imageTag, String specifiedBranch); boolean isSameBranchOrHasImageNamePrefix(String branchName); boolean useSpecifiedBranchOverride(); String getBranchName(); String getImageName(); String getImageTag();  }
@Test(dataProvider = "sameBranchOrImageNamePrefix") public void testIsSameBranchOrHasImageNamePrefix(String imageName, String imageTag, String specifiedBranch, String inputBranch, boolean expectedResult) { assertEquals(new GitForkBranch(imageName, imageTag, specifiedBranch).isSameBranchOrHasImageNamePrefix(inputBranch), expectedResult); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testIsSameBranchOrHasImageNamePrefix() { new GitForkBranch("", "1", ""); }