Restore TransactionOperations Kotlin API compatibilty
This commit renames the Runnable variant to executeWithoutResult and uses a Consumer<TransactionStatus> parameter for better consistency with TransactionCallbackWithoutResult. Closes gh-23724
This commit is contained in:
@@ -83,22 +83,22 @@ public class JCacheEhCacheAnnotationTests extends AbstractCacheAnnotationTests {
|
||||
|
||||
@Test
|
||||
public void testEvictWithTransaction() {
|
||||
txTemplate.execute(() -> testEvict(this.cs, false));
|
||||
txTemplate.executeWithoutResult(s -> testEvict(this.cs, false));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEvictEarlyWithTransaction() {
|
||||
txTemplate.execute(() -> testEvictEarly(this.cs));
|
||||
txTemplate.executeWithoutResult(s -> testEvictEarly(this.cs));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEvictAllWithTransaction() {
|
||||
txTemplate.execute(() -> testEvictAll(this.cs, false));
|
||||
txTemplate.executeWithoutResult(s -> testEvictAll(this.cs, false));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEvictAllEarlyWithTransaction() {
|
||||
txTemplate.execute(() -> testEvictAllEarly(this.cs));
|
||||
txTemplate.executeWithoutResult(s -> testEvictAllEarly(this.cs));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ public class TransactionAwareCacheDecoratorTests {
|
||||
Cache cache = new TransactionAwareCacheDecorator(target);
|
||||
Object key = new Object();
|
||||
|
||||
txTemplate.execute(() -> {
|
||||
txTemplate.executeWithoutResult(s -> {
|
||||
cache.put(key, "123");
|
||||
assertThat(target.get(key)).isNull();
|
||||
});
|
||||
@@ -106,7 +106,7 @@ public class TransactionAwareCacheDecoratorTests {
|
||||
Cache cache = new TransactionAwareCacheDecorator(target);
|
||||
Object key = new Object();
|
||||
|
||||
txTemplate.execute(() -> {
|
||||
txTemplate.executeWithoutResult(s -> {
|
||||
assertThat(cache.putIfAbsent(key, "123")).isNull();
|
||||
assertThat(target.get(key, String.class)).isEqualTo("123");
|
||||
assertThat(cache.putIfAbsent(key, "456").get()).isEqualTo("123");
|
||||
@@ -135,7 +135,7 @@ public class TransactionAwareCacheDecoratorTests {
|
||||
Object key = new Object();
|
||||
cache.put(key, "123");
|
||||
|
||||
txTemplate.execute(() -> {
|
||||
txTemplate.executeWithoutResult(s -> {
|
||||
cache.evict(key);
|
||||
assertThat(target.get(key, String.class)).isEqualTo("123");
|
||||
});
|
||||
@@ -161,7 +161,7 @@ public class TransactionAwareCacheDecoratorTests {
|
||||
Object key = new Object();
|
||||
cache.put(key, "123");
|
||||
|
||||
txTemplate.execute(() -> {
|
||||
txTemplate.executeWithoutResult(s -> {
|
||||
cache.evictIfPresent(key);
|
||||
assertThat(target.get(key)).isNull();
|
||||
});
|
||||
@@ -187,7 +187,7 @@ public class TransactionAwareCacheDecoratorTests {
|
||||
Object key = new Object();
|
||||
cache.put(key, "123");
|
||||
|
||||
txTemplate.execute(() -> {
|
||||
txTemplate.executeWithoutResult(s -> {
|
||||
cache.clear();
|
||||
assertThat(target.get(key, String.class)).isEqualTo("123");
|
||||
});
|
||||
@@ -213,7 +213,7 @@ public class TransactionAwareCacheDecoratorTests {
|
||||
Object key = new Object();
|
||||
cache.put(key, "123");
|
||||
|
||||
txTemplate.execute(() -> {
|
||||
txTemplate.executeWithoutResult(s -> {
|
||||
cache.invalidate();
|
||||
assertThat(target.get(key)).isNull();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user