#2 - Polishing

Moved more logic into value objects to ease testability. Branches now know whether they're an issue branch for a given tracker. TicketBranches now implements Streamable and allows obtaining a new instance with only resolved tickets in it an inspect whether a it contains a ticket for a given Branch.

Cleaned up GitOperations and GitCommands to make use of the new functionality. "git issuebranches" command was tweaked to default resolvable to true in case the option is set.

Renamed GitHubConnector to correct case. Fixed imports in GitHubIssueTracker.

Formatting.
This commit is contained in:
Oliver Gierke
2016-02-14 17:12:51 +01:00
parent a94f109ae7
commit 7181e33e3f
13 changed files with 148 additions and 149 deletions

View File

@@ -22,6 +22,7 @@ import org.junit.Test;
import org.springframework.data.release.model.Iteration;
import org.springframework.data.release.model.IterationVersion;
import org.springframework.data.release.model.SimpleIterationVersion;
import org.springframework.data.release.model.Tracker;
import org.springframework.data.release.model.Version;
/**
@@ -42,4 +43,16 @@ public class BranchUnitTests {
IterationVersion iterationVersion = new SimpleIterationVersion(Version.of(1, 4), Iteration.SR1);
assertThat(Branch.from(iterationVersion).toString(), is("1.4.x"));
}
/**
* @see #2
*/
@Test
public void detectsIssueBranches() {
Branch branch = Branch.from("issue/DATACMNS-4711");
assertThat(branch.isIssueBranch(Tracker.JIRA), is(true));
assertThat(branch.isIssueBranch(Tracker.GITHUB), is(false));
}
}