Search in sources :

Example 11 with ReadFrom

use of io.lettuce.core.ReadFrom in project lettuce-core by lettuce-io.

the class MasterSlaveTest method noSlaveForRead.

@Test
void noSlaveForRead() {
    connection.setReadFrom(new ReadFrom() {

        @Override
        public List<RedisNodeDescription> select(Nodes nodes) {
            return Collections.emptyList();
        }
    });
    assertThatThrownBy(() -> slaveCall(connection)).isInstanceOf(RedisException.class);
}
Also used : List(java.util.List) ReadFrom(io.lettuce.core.ReadFrom) AbstractRedisClientTest(io.lettuce.core.AbstractRedisClientTest) Test(org.junit.jupiter.api.Test)

Aggregations

ReadFrom (io.lettuce.core.ReadFrom)11 Test (org.junit.jupiter.api.Test)10 RedisClusterNode (io.lettuce.core.cluster.models.partitions.RedisClusterNode)8 RedisNodeDescription (io.lettuce.core.models.role.RedisNodeDescription)8 List (java.util.List)4 AbstractRedisClientTest (io.lettuce.core.AbstractRedisClientTest)2 ArrayList (java.util.ArrayList)2 ConnectionFuture (io.lettuce.core.ConnectionFuture)1 OrderingReadFromAccessor (io.lettuce.core.OrderingReadFromAccessor)1 RedisChannelWriter (io.lettuce.core.RedisChannelWriter)1 RedisConnectionException (io.lettuce.core.RedisConnectionException)1 RedisException (io.lettuce.core.RedisException)1 RedisFuture (io.lettuce.core.RedisFuture)1 RedisURI (io.lettuce.core.RedisURI)1 StatefulConnection (io.lettuce.core.api.StatefulConnection)1 StatefulRedisConnection (io.lettuce.core.api.StatefulRedisConnection)1 PushMessage (io.lettuce.core.api.push.PushMessage)1 ConnectionKey (io.lettuce.core.cluster.ClusterNodeConnectionFactory.ConnectionKey)1 RedisClusterPushListener (io.lettuce.core.cluster.api.push.RedisClusterPushListener)1 Partitions (io.lettuce.core.cluster.models.partitions.Partitions)1