Search in sources :

Example 11 with HostAndPort

use of io.lettuce.core.internal.HostAndPort in project lettuce-core by lettuce-io.

the class ClusterDistributionChannelWriterUnitTests method shouldParseAskTargetCorrectly.

@Test
void shouldParseAskTargetCorrectly() {
    HostAndPort askTarget = ClusterDistributionChannelWriter.getAskTarget("ASK 1234-2020 127.0.0.1:6381");
    assertThat(askTarget.getHostText()).isEqualTo("127.0.0.1");
    assertThat(askTarget.getPort()).isEqualTo(6381);
}
Also used : HostAndPort(io.lettuce.core.internal.HostAndPort) Test(org.junit.jupiter.api.Test)

Aggregations

HostAndPort (io.lettuce.core.internal.HostAndPort)11 Test (org.junit.jupiter.api.Test)4 RedisURI (io.lettuce.core.RedisURI)3 ArrayList (java.util.ArrayList)2 StatefulRedisConnection (io.lettuce.core.api.StatefulRedisConnection)1 Intent (io.lettuce.core.cluster.ClusterConnectionProvider.Intent)1 AskRedirectionEvent (io.lettuce.core.cluster.event.AskRedirectionEvent)1 MovedRedirectionEvent (io.lettuce.core.cluster.event.MovedRedirectionEvent)1 DefaultEndpoint (io.lettuce.core.protocol.DefaultEndpoint)1 InetSocketAddress (java.net.InetSocketAddress)1 UnknownHostException (java.net.UnknownHostException)1 ByteBuffer (java.nio.ByteBuffer)1 RedisSentinelConfiguration (org.springframework.data.redis.connection.RedisSentinelConfiguration)1 RedisStandaloneConfiguration (org.springframework.data.redis.connection.RedisStandaloneConfiguration)1 LettuceConnectionFactory (org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory)1