Search in sources :

Example 1 with JedisCommands

use of redis.clients.jedis.commands.JedisCommands in project conductor by Netflix.

the class DynoQueueDAOTest method init.

@Before
public void init() {
    JedisCommands jedisMock = new JedisMock();
    queueDAO = new DynoQueueDAO(jedisMock, jedisMock, new ShardSupplier() {

        @Override
        public Set<String> getQueueShards() {
            return new HashSet<>(Collections.singletonList("a"));
        }

        @Override
        public String getCurrentShard() {
            return "a";
        }

        @Override
        public String getShardForHost(Host host) {
            return "a";
        }
    }, new TestConfiguration());
}
Also used : JedisCommands(redis.clients.jedis.commands.JedisCommands) DynoQueueDAO(com.netflix.conductor.dao.dynomite.queue.DynoQueueDAO) TestConfiguration(com.netflix.conductor.config.TestConfiguration) JedisMock(com.netflix.conductor.dao.redis.JedisMock) Host(com.netflix.dyno.connectionpool.Host) ShardSupplier(com.netflix.dyno.queues.ShardSupplier) HashSet(java.util.HashSet) Before(org.junit.Before)

Example 2 with JedisCommands

use of redis.clients.jedis.commands.JedisCommands in project conductor by Netflix.

the class RedisMetadataDAOTest method init.

@Before
public void init() {
    Configuration config = new TestConfiguration();
    JedisCommands jedisMock = new JedisMock();
    DynoProxy dynoClient = new DynoProxy(jedisMock);
    redisMetadataDAO = new RedisMetadataDAO(dynoClient, objectMapper, config);
}
Also used : JedisCommands(redis.clients.jedis.commands.JedisCommands) Configuration(com.netflix.conductor.core.config.Configuration) TestConfiguration(com.netflix.conductor.config.TestConfiguration) DynoProxy(com.netflix.conductor.dyno.DynoProxy) TestConfiguration(com.netflix.conductor.config.TestConfiguration) JedisMock(com.netflix.conductor.dao.redis.JedisMock) Before(org.junit.Before)

Example 3 with JedisCommands

use of redis.clients.jedis.commands.JedisCommands in project conductor by Netflix.

the class RedisPollDataDAOTest method init.

@Before
public void init() {
    Configuration config = new TestConfiguration();
    JedisCommands jedisMock = new JedisMock();
    DynoProxy dynoClient = new DynoProxy(jedisMock);
    pollDataDAO = new RedisPollDataDAO(dynoClient, objectMapper, config);
}
Also used : JedisCommands(redis.clients.jedis.commands.JedisCommands) Configuration(com.netflix.conductor.core.config.Configuration) TestConfiguration(com.netflix.conductor.config.TestConfiguration) DynoProxy(com.netflix.conductor.dyno.DynoProxy) TestConfiguration(com.netflix.conductor.config.TestConfiguration) JedisMock(com.netflix.conductor.dao.redis.JedisMock) Before(org.junit.Before)

Example 4 with JedisCommands

use of redis.clients.jedis.commands.JedisCommands in project conductor by Netflix.

the class RedisRateLimitDaoTest method init.

@Before
public void init() {
    Configuration config = new TestConfiguration();
    JedisCommands jedisMock = new JedisMock();
    DynoProxy dynoClient = new DynoProxy(jedisMock);
    rateLimitingDao = new RedisRateLimitingDAO(dynoClient, objectMapper, config);
}
Also used : JedisCommands(redis.clients.jedis.commands.JedisCommands) Configuration(com.netflix.conductor.core.config.Configuration) TestConfiguration(com.netflix.conductor.config.TestConfiguration) DynoProxy(com.netflix.conductor.dyno.DynoProxy) TestConfiguration(com.netflix.conductor.config.TestConfiguration) JedisMock(com.netflix.conductor.dao.redis.JedisMock) Before(org.junit.Before)

Example 5 with JedisCommands

use of redis.clients.jedis.commands.JedisCommands in project conductor by Netflix.

the class MockQueueDAOModule method configureQueueDAO.

@Override
public void configureQueueDAO() {
    DetachedMockFactory detachedMockFactory = new DetachedMockFactory();
    JedisCommands jedisMock = new JedisMock();
    ShardSupplier shardSupplier = new ShardSupplier() {

        @Override
        public Set<String> getQueueShards() {
            return new HashSet<>(Collections.singletonList("a"));
        }

        @Override
        public String getCurrentShard() {
            return "a";
        }

        @Override
        public String getShardForHost(Host host) {
            return "a";
        }
    };
    RedisQueues redisQueues = new RedisQueues(jedisMock, jedisMock, "mockedQueues", shardSupplier, 60000, 120000);
    DynoQueueDAO dynoQueueDAO = new DynoQueueDAO(redisQueues);
    bind(QueueDAO.class).toInstance(detachedMockFactory.Spy(dynoQueueDAO));
    install(new WorkflowExecutorModule());
}
Also used : DynoQueueDAO(com.netflix.conductor.dao.dynomite.queue.DynoQueueDAO) QueueDAO(com.netflix.conductor.dao.QueueDAO) JedisCommands(redis.clients.jedis.commands.JedisCommands) DynoQueueDAO(com.netflix.conductor.dao.dynomite.queue.DynoQueueDAO) WorkflowExecutorModule(com.netflix.conductor.core.execution.WorkflowExecutorModule) JedisMock(com.netflix.conductor.jedis.JedisMock) Host(com.netflix.dyno.connectionpool.Host) RedisQueues(com.netflix.dyno.queues.redis.RedisQueues) DetachedMockFactory(spock.mock.DetachedMockFactory) ShardSupplier(com.netflix.dyno.queues.ShardSupplier) HashSet(java.util.HashSet)

Aggregations

JedisCommands (redis.clients.jedis.commands.JedisCommands)10 TestConfiguration (com.netflix.conductor.config.TestConfiguration)6 JedisMock (com.netflix.conductor.dao.redis.JedisMock)6 Before (org.junit.Before)6 Configuration (com.netflix.conductor.core.config.Configuration)5 DynoProxy (com.netflix.conductor.dyno.DynoProxy)5 HashSet (java.util.HashSet)4 DynoQueueDAO (com.netflix.conductor.dao.dynomite.queue.DynoQueueDAO)2 Host (com.netflix.dyno.connectionpool.Host)2 ShardSupplier (com.netflix.dyno.queues.ShardSupplier)2 Entry (java.util.Map.Entry)2 WorkflowExecutorModule (com.netflix.conductor.core.execution.WorkflowExecutorModule)1 QueueDAO (com.netflix.conductor.dao.QueueDAO)1 JedisMock (com.netflix.conductor.jedis.JedisMock)1 RedisQueues (com.netflix.dyno.queues.redis.RedisQueues)1 HashMap (java.util.HashMap)1 ScanParams (redis.clients.jedis.ScanParams)1 DetachedMockFactory (spock.mock.DetachedMockFactory)1