Make RedisConnectionProxy public.
RedisConnectionProxy is now public so it can be used properly for Java proxy creation across different class loaders. Previously, creating a Java proxy from a different class loader failed because of visibility/access restrictions. Closes #2016
This commit is contained in:
@@ -626,7 +626,7 @@ public abstract class RedisConnectionUtils {
|
||||
* @since 2.4.2
|
||||
* @see RedisConnectionUtils#getTargetConnection(RedisConnection)
|
||||
*/
|
||||
interface RedisConnectionProxy extends RedisConnection, RawTargetAccess {
|
||||
public interface RedisConnectionProxy extends RedisConnection, RawTargetAccess {
|
||||
|
||||
/**
|
||||
* Return the target {@link RedisConnection} of this proxy.
|
||||
|
||||
@@ -104,14 +104,15 @@ class RedisConnectionUtilsUnitTests {
|
||||
assertThat(TransactionSynchronizationManager.hasResource(factoryMock)).isFalse();
|
||||
}
|
||||
|
||||
@Test // DATAREDIS-891
|
||||
@Test // DATAREDIS-891, GH-2016
|
||||
void bindConnectionShouldBindConnectionToOngoingTransactionScope() {
|
||||
|
||||
TransactionTemplate template = new TransactionTemplate(new DummyTransactionManager());
|
||||
|
||||
template.executeWithoutResult(status -> {
|
||||
|
||||
assertThat(RedisConnectionUtils.bindConnection(factoryMock, true)).isNotNull();
|
||||
assertThat(RedisConnectionUtils.bindConnection(factoryMock, true))
|
||||
.isInstanceOf(RedisConnectionUtils.RedisConnectionProxy.class);
|
||||
assertThat(TransactionSynchronizationManager.hasResource(factoryMock)).isTrue();
|
||||
assertThat(RedisConnectionUtils.getConnection(factoryMock)).isNotNull();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user