Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
v1r3n committed Dec 19, 2023
1 parent 39faefd commit 7dcb6c2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Apache License
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright {yyyy} Netflix, Inc.
Copyright {yyyy} Orkes, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion redis-lock/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ dependencies {
implementation "org.apache.commons:commons-lang3"
implementation "org.redisson:redisson:${revRedisson}"

testImplementation "com.github.kstyrc:embedded-redis:${revEmbeddedRedis}"
testImplementation "org.testcontainers:testcontainers:${revTestContainer}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import com.netflix.conductor.redislock.config.RedisLockProperties.REDIS_SERVER_TYPE;
import com.netflix.conductor.redislock.lock.RedisLock;

import redis.embedded.RedisServer;
import org.testcontainers.containers.*;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
Expand All @@ -38,16 +38,16 @@ public class RedisLockTest {
private static RedisLock redisLock;
private static Config config;
private static RedissonClient redisson;
private static RedisServer redisServer = null;

static GenericContainer redis = new GenericContainer("redis:5.0.3-alpine")
.withExposedPorts(6379);

@BeforeClass
public static void setUp() throws Exception {
String testServerAddress = "redis://127.0.0.1:6371";
redisServer = new RedisServer(6371);
if (redisServer.isActive()) {
redisServer.stop();
}
redisServer.start();
redis.start();
int port = redis.getFirstMappedPort();
String host = redis.getHost();
String testServerAddress = "redis://" + host + ":" + port;

RedisLockProperties properties = mock(RedisLockProperties.class);
when(properties.getServerType()).thenReturn(REDIS_SERVER_TYPE.SINGLE);
Expand All @@ -68,7 +68,7 @@ public static void setUp() throws Exception {

@AfterClass
public static void tearDown() {
redisServer.stop();
redis.stop();
}

@Test
Expand Down

0 comments on commit 7dcb6c2

Please sign in to comment.