Move helped test methods
This commit is contained in:
parent
9c6c2bc247
commit
002429e978
1 changed files with 13 additions and 11 deletions
|
@ -172,6 +172,11 @@ class GitDBTest implements WithAssertions {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Given a valid GitDb handle
|
// Given a valid GitDb handle
|
||||||
|
|
||||||
|
private GitDB gitDB(final Path dbDir) throws IOException {
|
||||||
|
return GitDB.initLocal(dbDir, userName, userEmailAddress);
|
||||||
|
}
|
||||||
|
|
||||||
// When select a branch that doesn't exist then an empty Optional is returned
|
// When select a branch that doesn't exist then an empty Optional is returned
|
||||||
@Test
|
@Test
|
||||||
void selectBranch_whenBranchNotExist_thenEmptyOptional() throws IOException {
|
void selectBranch_whenBranchNotExist_thenEmptyOptional() throws IOException {
|
||||||
|
@ -183,10 +188,6 @@ class GitDBTest implements WithAssertions {
|
||||||
assertThat(branch).isEmpty();
|
assertThat(branch).isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
private GitDB gitDB(final Path dbDir) throws IOException {
|
|
||||||
return GitDB.initLocal(dbDir, userName, userEmailAddress);
|
|
||||||
}
|
|
||||||
|
|
||||||
// When select a valid branch then a GitDbBranch is returned
|
// When select a valid branch then a GitDbBranch is returned
|
||||||
@Test
|
@Test
|
||||||
void selectBranch_branchExists_thenReturnBranch() throws IOException {
|
void selectBranch_branchExists_thenReturnBranch() throws IOException {
|
||||||
|
@ -200,6 +201,14 @@ class GitDBTest implements WithAssertions {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Given a valid GitDbBranch handle
|
// Given a valid GitDbBranch handle
|
||||||
|
|
||||||
|
private GitDBBranch gitDBBranch() throws IOException {
|
||||||
|
final GitDB gitDB = gitDB(dirDoesNotExist());
|
||||||
|
final Optional<GitDBBranch> branchOptional = gitDB.branch("master");
|
||||||
|
assumeThat(branchOptional).isNotEmpty();
|
||||||
|
return branchOptional.get();
|
||||||
|
}
|
||||||
|
|
||||||
// When getting a key that does not exist then return an empty Optional
|
// When getting a key that does not exist then return an empty Optional
|
||||||
@Test
|
@Test
|
||||||
void getKey_whenKeyNotExist_thenReturnEmptyOptional() throws IOException, ClassNotFoundException {
|
void getKey_whenKeyNotExist_thenReturnEmptyOptional() throws IOException, ClassNotFoundException {
|
||||||
|
@ -211,13 +220,6 @@ class GitDBTest implements WithAssertions {
|
||||||
assertThat(value).isEmpty();
|
assertThat(value).isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
private GitDBBranch gitDBBranch() throws IOException {
|
|
||||||
final GitDB gitDB = gitDB(dirDoesNotExist());
|
|
||||||
final Optional<GitDBBranch> branchOptional = gitDB.branch("master");
|
|
||||||
assumeThat(branchOptional).isNotEmpty();
|
|
||||||
return branchOptional.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
// When getting the format version it matches expected
|
// When getting the format version it matches expected
|
||||||
@Test
|
@Test
|
||||||
void getVersionFormat_thenFormatIsSet() throws IOException {
|
void getVersionFormat_thenFormatIsSet() throws IOException {
|
||||||
|
|
Loading…
Reference in a new issue