diff --git a/src/test/java/com/lambdaworks/redis/CustomCodecTest.java b/src/test/java/com/lambdaworks/redis/CustomCodecTest.java index d6e36fb88e..12544454f4 100644 --- a/src/test/java/com/lambdaworks/redis/CustomCodecTest.java +++ b/src/test/java/com/lambdaworks/redis/CustomCodecTest.java @@ -13,6 +13,7 @@ import java.nio.charset.Charset; import java.util.List; +import com.lambdaworks.redis.codec.ByteArrayCodec; import org.junit.Test; import com.lambdaworks.redis.codec.RedisCodec; @@ -26,6 +27,17 @@ public void test() throws Exception { assertThat(connection.get(key)).isEqualTo(list); } + @Test + public void testByteCodec() throws Exception { + RedisConnection connection = client.connect(new ByteArrayCodec()); + String value = "üöäü+#"; + connection.set(key.getBytes(), value.getBytes()); + assertThat(connection.get(key.getBytes())).isEqualTo(value.getBytes()); + + List keys = connection.keys(key.getBytes()); + assertThat(keys).contains(key.getBytes()); + } + public class SerializedObjectCodec extends RedisCodec { private Charset charset = Charset.forName("UTF-8");