Search in sources :

Example 1 with PfAddParser

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

the class ParserTest method testPfAddParser.

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

Aggregations

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