|
1 | 1 | /*
|
2 |
| - * Copyright 2014-2023 the original author or authors. |
| 2 | + * Copyright 2014-2024 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
41 | 41 | import org.junit.jupiter.api.AfterEach;
|
42 | 42 | import org.junit.jupiter.api.BeforeAll;
|
43 | 43 | import org.junit.jupiter.api.BeforeEach;
|
| 44 | +import org.junit.jupiter.api.Test; |
44 | 45 | import org.junit.jupiter.params.ParameterizedTest;
|
45 | 46 | import org.junit.jupiter.params.provider.EnumSource;
|
46 | 47 |
|
|
52 | 53 |
|
53 | 54 | import static org.assertj.core.api.Assertions.assertThat;
|
54 | 55 | import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
| 56 | +import static org.assertj.core.api.Assertions.assertThatNoException; |
| 57 | +import static org.mockito.Mockito.mock; |
55 | 58 |
|
56 | 59 | /**
|
57 | 60 | * @author Gary Russell
|
@@ -875,6 +878,13 @@ void testTwoThreadsRemoveAndObtainSameLockSimultaneously(RedisLockType testRedis
|
875 | 878 | registry.destroy();
|
876 | 879 | }
|
877 | 880 |
|
| 881 | + @Test |
| 882 | + void testInitialiseWithCustomExecutor() { |
| 883 | + RedisLockRegistry redisLockRegistry = new RedisLockRegistry(redisConnectionFactory, "registryKey"); |
| 884 | + redisLockRegistry.setRedisLockType(RedisLockType.PUB_SUB_LOCK); |
| 885 | + assertThatNoException().isThrownBy(() -> redisLockRegistry.setExecutor(mock())); |
| 886 | + } |
| 887 | + |
878 | 888 | private Long getExpire(RedisLockRegistry registry, String lockKey) {
|
879 | 889 | StringRedisTemplate template = createTemplate();
|
880 | 890 | String registryKey = TestUtils.getPropertyValue(registry, "registryKey", String.class);
|
|
0 commit comments