Search in sources :

Example 1 with HDelParser

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

the class ParserTest method testHDelParser.

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

Aggregations

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