Search in sources :

Example 1 with RPushParser

use of org.apache.rocketmq.connect.redis.parser.RPushParser in project rocketmq-externals by apache.

the class ParserTest method testRPushParser.

@Test
public void testRPushParser() {
    String command = "RPUSH key v1 v2";
    KVEntry builder = new RPushParser().parse(parseCommand(command));
    Assert.assertEquals("RPUSH", builder.getCommand());
    Assert.assertEquals("key", builder.getKey());
    List<String> res = (List<String>) builder.getValue();
    Assert.assertEquals(2, res.size());
    Assert.assertEquals("v1", res.get(0));
    Assert.assertEquals("v2", res.get(1));
}
Also used : RPushParser(org.apache.rocketmq.connect.redis.parser.RPushParser) KVEntry(org.apache.rocketmq.connect.redis.pojo.KVEntry) List(java.util.List) Test(org.junit.Test)

Aggregations

List (java.util.List)1 RPushParser (org.apache.rocketmq.connect.redis.parser.RPushParser)1 KVEntry (org.apache.rocketmq.connect.redis.pojo.KVEntry)1 Test (org.junit.Test)1