Search in sources :

Example 1 with LTrimParser

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

the class ParserTest method testLTrimParser.

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

Aggregations

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