Merge branch '6.1.x'

This commit is contained in:
Juergen Hoeller
2024-03-05 18:24:01 +01:00
7 changed files with 29 additions and 24 deletions

View File

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