@@ -95,6 +95,7 @@ public void commitWithoutExistingTransaction() {
95
95
assertHasCommitted (tm );
96
96
assertHasNoRollback (tm );
97
97
assertHasNotSetRollbackOnly (tm );
98
+ assertHasCleanedUp (tm );
98
99
}
99
100
100
101
@ Test
@@ -108,6 +109,7 @@ public void rollbackWithoutExistingTransaction() {
108
109
assertHasNotCommitted (tm );
109
110
assertHasRolledBack (tm );
110
111
assertHasNotSetRollbackOnly (tm );
112
+ assertHasCleanedUp (tm );
111
113
}
112
114
113
115
@ Test
@@ -122,6 +124,7 @@ public void rollbackOnlyWithoutExistingTransaction() {
122
124
assertHasNotCommitted (tm );
123
125
assertHasRolledBack (tm );
124
126
assertHasNotSetRollbackOnly (tm );
127
+ assertHasCleanedUp (tm );
125
128
}
126
129
127
130
@ Test
@@ -135,6 +138,7 @@ public void commitWithExistingTransaction() {
135
138
assertHasNotCommitted (tm );
136
139
assertHasNoRollback (tm );
137
140
assertHasNotSetRollbackOnly (tm );
141
+ assertHasNotCleanedUp (tm );
138
142
}
139
143
140
144
@ Test
@@ -148,6 +152,7 @@ public void rollbackWithExistingTransaction() {
148
152
assertHasNotCommitted (tm );
149
153
assertHasNoRollback (tm );
150
154
assertHasSetRollbackOnly (tm );
155
+ assertHasNotCleanedUp (tm );
151
156
}
152
157
153
158
@ Test
@@ -161,6 +166,7 @@ public void rollbackOnlyWithExistingTransaction() {
161
166
assertHasNotCommitted (tm );
162
167
assertHasNoRollback (tm );
163
168
assertHasSetRollbackOnly (tm );
169
+ assertHasNotCleanedUp (tm );
164
170
}
165
171
166
172
@ Test
@@ -177,6 +183,7 @@ public void transactionTemplate() {
177
183
assertHasCommitted (tm );
178
184
assertHasNoRollback (tm );
179
185
assertHasNotSetRollbackOnly (tm );
186
+ assertHasCleanedUp (tm );
180
187
}
181
188
182
189
@ Test
@@ -194,6 +201,7 @@ public void transactionTemplateWithException() {
194
201
assertHasNotCommitted (tm );
195
202
assertHasRolledBack (tm );
196
203
assertHasNotSetRollbackOnly (tm );
204
+ assertHasCleanedUp (tm );
197
205
}
198
206
199
207
private void assertHasBegan (ReactiveTestTransactionManager actual ) {
@@ -228,4 +236,12 @@ private void assertHasNotSetRollbackOnly(ReactiveTestTransactionManager actual)
228
236
assertFalse ("Expected to not call <ReactiveTransactionManager.setRollbackOnly()> but was <setRollbackOnly()> was called" , actual .rollbackOnly );
229
237
}
230
238
239
+ private void assertHasCleanedUp (ReactiveTestTransactionManager actual ) {
240
+ assertTrue ("Expected <ReactiveTransactionManager.doCleanupAfterCompletion()> but was <doCleanupAfterCompletion()> was not invoked" , actual .cleanup );
241
+ }
242
+
243
+ private void assertHasNotCleanedUp (ReactiveTestTransactionManager actual ) {
244
+ assertFalse ("Expected to not call <ReactiveTransactionManager.doCleanupAfterCompletion()> but was <doCleanupAfterCompletion()> was called" , actual .cleanup );
245
+ }
246
+
231
247
}
0 commit comments