From bd4306bbc0b62fc0d2dd9815e7d2f7e38edeb6b5 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Fri, 15 Jun 2018 14:37:36 +0100 Subject: [PATCH] When starting an anonymous transaction then a GitDbTransaction is returned --- src/test/java/net/kemitix/gitdb/test/GitDBTest.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/test/java/net/kemitix/gitdb/test/GitDBTest.java b/src/test/java/net/kemitix/gitdb/test/GitDBTest.java index 3b0ad66..8f5833d 100644 --- a/src/test/java/net/kemitix/gitdb/test/GitDBTest.java +++ b/src/test/java/net/kemitix/gitdb/test/GitDBTest.java @@ -326,6 +326,18 @@ class GitDBTest implements WithAssertions { } // When starting an anonymous transaction then a GitDbTransaction is returned + @Test + void startAnonymousTransaction_thenReturnGitDBTransaction() throws IOException { + //given + final String key = stringSupplier.get(); + final String value = stringSupplier.get(); + final GitDBBranch gitDBBranch = gitDBBranchWithKeyValue(key, value); + //when + final GitDBTransaction transaction = gitDBBranch.transaction(); + //then + assertThat(transaction).isNotNull(); + assertThat(transaction.name()).isNotNull(); + } // Given a GitDbTransaction handle (i.e. a new branch) // When putting a new key/value pair then the original GitDbBranch can't find it