|
|
|
@ -107,32 +107,32 @@ class TransactionAspectTests { |
|
|
|
void defaultCommitOnAnnotatedClass() { |
|
|
|
void defaultCommitOnAnnotatedClass() { |
|
|
|
Exception ex = new Exception(); |
|
|
|
Exception ex = new Exception(); |
|
|
|
assertThatException() |
|
|
|
assertThatException() |
|
|
|
.isThrownBy(() -> testRollback(() -> annotationOnlyOnClassWithNoInterface.echo(ex), false)) |
|
|
|
.isThrownBy(() -> testRollback(() -> annotationOnlyOnClassWithNoInterface.echo(ex), false)) |
|
|
|
.isSameAs(ex); |
|
|
|
.isSameAs(ex); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void defaultRollbackOnAnnotatedClass() { |
|
|
|
void defaultRollbackOnAnnotatedClass() { |
|
|
|
RuntimeException ex = new RuntimeException(); |
|
|
|
RuntimeException ex = new RuntimeException(); |
|
|
|
assertThatRuntimeException() |
|
|
|
assertThatRuntimeException() |
|
|
|
.isThrownBy(() -> testRollback(() -> annotationOnlyOnClassWithNoInterface.echo(ex), true)) |
|
|
|
.isThrownBy(() -> testRollback(() -> annotationOnlyOnClassWithNoInterface.echo(ex), true)) |
|
|
|
.isSameAs(ex); |
|
|
|
.isSameAs(ex); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void defaultCommitOnSubclassOfAnnotatedClass() { |
|
|
|
void defaultCommitOnSubclassOfAnnotatedClass() { |
|
|
|
Exception ex = new Exception(); |
|
|
|
Exception ex = new Exception(); |
|
|
|
assertThatException() |
|
|
|
assertThatException() |
|
|
|
.isThrownBy(() -> testRollback(() -> new SubclassOfClassWithTransactionalAnnotation().echo(ex), false)) |
|
|
|
.isThrownBy(() -> testRollback(() -> new SubclassOfClassWithTransactionalAnnotation().echo(ex), false)) |
|
|
|
.isSameAs(ex); |
|
|
|
.isSameAs(ex); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void defaultCommitOnSubclassOfClassWithTransactionalMethodAnnotated() { |
|
|
|
void defaultCommitOnSubclassOfClassWithTransactionalMethodAnnotated() { |
|
|
|
Exception ex = new Exception(); |
|
|
|
Exception ex = new Exception(); |
|
|
|
assertThatException() |
|
|
|
assertThatException() |
|
|
|
.isThrownBy(() -> testRollback(() -> new SubclassOfClassWithTransactionalMethodAnnotation().echo(ex), false)) |
|
|
|
.isThrownBy(() -> testRollback(() -> new SubclassOfClassWithTransactionalMethodAnnotation().echo(ex), false)) |
|
|
|
.isSameAs(ex); |
|
|
|
.isSameAs(ex); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
@ -168,8 +168,8 @@ class TransactionAspectTests { |
|
|
|
txManager.clear(); |
|
|
|
txManager.clear(); |
|
|
|
assertThat(txManager.begun).isEqualTo(0); |
|
|
|
assertThat(txManager.begun).isEqualTo(0); |
|
|
|
assertThatExceptionOfType(Throwable.class) |
|
|
|
assertThatExceptionOfType(Throwable.class) |
|
|
|
.isThrownBy(toc::performTransactionalOperation) |
|
|
|
.isThrownBy(toc::performTransactionalOperation) |
|
|
|
.isSameAs(expected); |
|
|
|
.isSameAs(expected); |
|
|
|
assertThat(txManager.begun).isEqualTo(0); |
|
|
|
assertThat(txManager.begun).isEqualTo(0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|