Skip to content

Commit 7a99dc6

Browse files
committed
feat: add test to assert dependency injection in rollback
1 parent 6929e0c commit 7a99dc6

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

e2e/core-e2e/src/test/java/io/flamingock/core/e2e/CoreStrategiesE2ETest.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ void testDependencyInjectionInRollbackForNonTxChange() {
234234

235235
Counter counter = new Counter();
236236

237-
NonTransactionalTargetSystem targetSystem = new NonTransactionalTargetSystem( "kafka")
237+
NonTransactionalTargetSystem targetSystem = new NonTransactionalTargetSystem("kafka")
238238
.addDependency(counter);
239239

240240
try (MockedStatic<Deserializer> mocked = Mockito.mockStatic(Deserializer.class)) {
@@ -244,14 +244,15 @@ void testDependencyInjectionInRollbackForNonTxChange() {
244244
)
245245
);
246246

247-
try {
247+
PipelineExecutionException exception = assertThrows(PipelineExecutionException.class, () -> {
248248
testKit.createBuilder()
249249
.addTargetSystem(targetSystem)
250250
.build()
251251
.run();
252-
} catch (PipelineExecutionException e) {
253-
// Exception is expected, do not fail the test
254-
}
252+
});
253+
254+
assertNotNull(exception);
255+
assertTrue(exception.getMessage().contains("Intentional failure"));
255256
}
256257

257258
assertTrue(counter.isExecuted(), "Counter.executed should be true after execution");

0 commit comments

Comments
 (0)