File tree Expand file tree Collapse file tree 2 files changed +24
-19
lines changed
src/test/java/net/javacrumbs/shedlock/provider/jedis Expand file tree Collapse file tree 2 files changed +24
-19
lines changed Original file line number Diff line number Diff line change 10
10
<artifactId >shedlock-provider-jedis</artifactId >
11
11
<version >0.10.1-SNAPSHOT</version >
12
12
13
- <!-- disable tests by default to avoid redis dependancy for now -->
14
- <properties >
15
- <skipTests >true</skipTests >
16
- </properties >
17
-
18
- <build >
19
- <plugins >
20
- <plugin >
21
- <groupId >org.apache.maven.plugins</groupId >
22
- <artifactId >maven-surefire-plugin</artifactId >
23
- <configuration >
24
- <skipTests >${skipTests} </skipTests >
25
- </configuration >
26
- </plugin >
27
- </plugins >
28
- </build >
29
-
30
13
<dependencies >
31
14
<dependency >
32
15
<groupId >net.javacrumbs.shedlock</groupId >
47
30
<scope >test</scope >
48
31
</dependency >
49
32
33
+
34
+ <dependency >
35
+ <groupId >com.github.kstyrc</groupId >
36
+ <artifactId >embedded-redis</artifactId >
37
+ <version >0.6</version >
38
+ <scope >test</scope >
39
+ </dependency >
50
40
</dependencies >
51
41
52
42
</project >
Original file line number Diff line number Diff line change 19
19
import net .javacrumbs .shedlock .core .LockProvider ;
20
20
import net .javacrumbs .shedlock .core .SimpleLock ;
21
21
import net .javacrumbs .shedlock .test .support .AbstractLockProviderIntegrationTest ;
22
+ import org .junit .AfterClass ;
22
23
import org .junit .Assert ;
23
24
import org .junit .Before ;
25
+ import org .junit .BeforeClass ;
24
26
import redis .clients .jedis .Jedis ;
25
27
import redis .clients .jedis .JedisPool ;
26
- import redis .clients . jedis . JedisPoolConfig ;
28
+ import redis .embedded . RedisServer ;
27
29
30
+ import java .io .IOException ;
28
31
import java .time .Duration ;
29
32
import java .util .Optional ;
30
33
34
37
public class JedisLockProviderIntegrationTest extends AbstractLockProviderIntegrationTest {
35
38
36
39
private static JedisPool jedisPool ;
40
+ private static RedisServer redisServer ;
37
41
private LockProvider lockProvider ;
38
42
39
- private final static int PORT = 6379 ;
43
+ private final static int PORT = 6380 ;
40
44
private final static String HOST = "localhost" ;
41
45
private final static String ENV = "test" ;
42
46
47
+ @ BeforeClass
48
+ public static void startRedis () throws IOException {
49
+ redisServer = new RedisServer (PORT );
50
+ redisServer .start ();
51
+ }
52
+
53
+ @ AfterClass
54
+ public static void stopRedis () {
55
+ redisServer .stop ();
56
+ }
57
+
43
58
@ Before
44
59
public void createLockProvider () {
45
60
jedisPool = new JedisPool (HOST , PORT );
You can’t perform that action at this time.
0 commit comments