Skip to content

Commit ddbe5f0

Browse files
committed
#80 fix merge errors
1 parent f8535b9 commit ddbe5f0

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/test/java/com/arangodb/springframework/transaction/ArangoTransactionManagerTest.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.mockito.Mock;
1818
import org.mockito.junit.MockitoJUnitRunner;
1919
import org.springframework.lang.Nullable;
20+
import org.springframework.test.util.ReflectionTestUtils;
2021
import org.springframework.transaction.*;
2122
import org.springframework.transaction.interceptor.DefaultTransactionAttribute;
2223
import org.springframework.transaction.support.DefaultTransactionStatus;
@@ -49,7 +50,6 @@ public class ArangoTransactionManagerTest {
4950
private ArangoTransactionManager underTest;
5051
@Mock
5152
private ArangoDatabase database;
52-
@Mock
5353
private StreamTransactionEntity streamTransaction;
5454
@Captor
5555
private ArgumentCaptor<Function<Collection<String>, String>> beginPassed;
@@ -58,6 +58,7 @@ public class ArangoTransactionManagerTest {
5858

5959
@Before
6060
public void setupMocks() {
61+
streamTransaction = new StreamTransactionEntity();
6162
when(operations.db())
6263
.thenReturn(database);
6364
}
@@ -124,8 +125,6 @@ public void nestedGetTransactionReturnsExistingTransactionWithFormerCollections(
124125
assertThat(outer.isNewTransaction(), is(true));
125126

126127
beginTransaction("123", "foo", "bar");
127-
when(streamTransaction.getStatus())
128-
.thenReturn(StreamTransactionStatus.running);
129128

130129
DefaultTransactionAttribute second = createTransactionAttribute("inner", "bar");
131130
TransactionStatus inner1 = underTest.getTransaction(second);
@@ -194,8 +193,8 @@ public void getTransactionThrowsInvalidIsolationLevelExceptionForIsolationSerial
194193
}
195194

196195
private void beginTransaction(String id, String... collectionNames) {
197-
when(streamTransaction.getId())
198-
.thenReturn(id);
196+
ReflectionTestUtils.setField(streamTransaction, "id", id);
197+
ReflectionTestUtils.setField(streamTransaction, "status", StreamTransactionStatus.running);
199198
when(database.beginStreamTransaction(any()))
200199
.thenReturn(streamTransaction);
201200
lenient().when(database.getStreamTransaction(any()))

0 commit comments

Comments
 (0)